Editing CFLAGS/CXXFLAGS in package Makefile

I have a package which includes a whole bunch of kernel drivers as well as userspace programs (it's the Intel Quick Assist drivers for C3000 platforms).

One of the userspace utilities is c++, so it's getting compiled using g++. However, the build errors out with

g++: error: unrecognized command line option '-fno-plt'
g++: error: unrecognized command line option '-fhonour-copts'
g++: error: unrecognized command line option '-fmacro-prefix-map=

Is there some way of removing these flags in my Makefile so that they are not passed?

This is the command the build system is running:

g++ -c -MMD -MP -O2 -pipe -fno-caller-saves -fno-plt -fhonour-copts 
-Wno-error=unused-but-set-variable -Wno-error=unused-result -fmacro-prefix-map=/opt/openwrt/build_dir/target-x86_64_glibc/linux-x86_c3xxx/quickassist-c3xxx-1.7=quickassist-c3xxx-1.7 
-Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -Wl,-z,now -Wl,-z,relro  
-I/opt/openwrt/staging_dir/target-x86_64_glibc/usr/include 
-I/opt/openwrt/staging_dir/target-x86_64_glibc/include 
-I/opt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_glibc/usr/include 
-I/opt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_glibc/include  
-std=c++0x -I/drivers/crypto/qat/qat_common -DQAT_UIO -fstack-protector 
-fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fno-strict-overflow 
-fno-delete-null-pointer-checks -fwrapv -o /opt/openwrt/build_dir/target-x86_64_glibc/linux-x86_c3xxx/quickassist-c3xxx-1.7/quickassist/utilities/adf_ctl/build/src/./adf_ctl.o adf_ctl.cpp

Ok, at least one of these flags appears to be an artefact of Openwrt itself. According to the toolchain patch, it seems the Makefile in the package is doing something unliked with target cflags. Now to find what the others mean....

Ok, problem fixed. Horrible Intel makefiles overriding variables and being generally extremely cross-compilation unfriendly...

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.