-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GCC compilation broken - again #78
Comments
It didn't work with GCC even before with flags from configure.ac (at least for me) or it was side effect, because imho we should check every flag that we add to CFLAGS etc with AC_COMPILE_IFELSE or AX_CHECK_COMPILE_FLAG then append it or not - to avoid issue that you get (invoking compiler with flags that it doesn't support) - it should had been done like this from the beginning if we want to support multiple compilers. Anyway I will make it work with mentioned macros - I just don't want to touch too many issues with one pull request, so I wanted to add it in next patches. Can you also send me your config.log, so I can see how you invoke configure and what you get? |
Also flags from top of configure.ac:
|
All the -m flags are xtensa specific and should be added to AM_CFLAGS as part of the target selction logic in config.ac. The -W flags -O2 should be present on all builds. |
Sorry, but I think it's wrong approach. Let me give you example.
However with how it works now it will add always -Wall etc flags to CFLAGS, what we shouldn't force. Maybe I'm missing some bigger picture and we should go against autotools conventions and force it. |
We need to force CFLAGS to the correct flags for our FW, tools and host testbench. AC_PROG_CC is failing as it invoke the xensa compiler without the correct flags for building binary FW images (i.e. its using default CFLAGS for building userspace ELF). |
If you only care about passing AC_PROG_CC, we can do something like:
Also compiler is not invoked at AC_PROG_CC statment, it's invoked first time when it's need, so atm it may be first invoked when autoconf checks if cmocka is available (cos it has to check if it can use function from linked lib). We can have default CFLAGS that are like our current flags, but I'm not sure if we should force it they way it is now. I can do as you want just want you to know that you make user unable to use one of feature of autoconf that is expected to work as I wrote (user should be able to override CFLAGS from configure step). |
@jajanusz: point taken, but in general people use ./configure CFLAGS="-O0" ... when they have access to a debugger. It's not really useful for firmware we mostly debug with traces, and if people have a need for this they can always edit the defaults. Let's just fix this and get out of this CI nightmare. |
This issue is fixed. |
@keqiaozhang can you add all the build targets into CI, i.e. host, testbench and unit tests too. Thanks. |
@keqiaozhang you need to build cmocka lib for every platform for UT, if you'll need help with this let me know |
@jajanusz @lgirdwood I will follow up and keep you updated. Thanks~ |
This issue is fixed by #105 |
I believe this issue has regressed again, I am experiencing this on master (at 597194f) in the docker container. from
|
Ignore the above comment, its something with docker-run script. If you jump into the containers bash then run the commands then things work fine. |
@cujomalainey
The configure fallback to gcc when find no cross-compiler. |
@xiulipan it was an error on my behalf, somehow I omitted the container script after I just finished building in the container. Apologies for reviving a dead thread. |
commit 17c929e ('autotools: replace user variables with automake variables') adds options that GCC doesn't understand
gcc -DHAVE_CONFIG_H -I. -I../../src/include -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -I /data/pbossart/SOF-public/sof-sdk/sof.git/src/arch/xtensa/include -I /data/pbossart/SOF-public/sof-sdk/sof.git/src/arch/xtensa/xtos -I /data/pbossart/SOF-public/sof-sdk/sof.git/src/platform/apollolake/include -I /data/pbossart/SOF-public/sof-sdk/sof.git/src/platform/intel/include -I /data/pbossart/SOF-public/sof-sdk/sof.git/src/platform/apollolake/include/arch -I /data/pbossart/SOF-public/sof-sdk/sof.git/src/include -I /data/pbossart/SOF-public/sof-sdk/sof.git/../xtensa-root/xtensa-apl-elf/include -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes -MT libinit_a-init.o -MD -MP -MF .deps/libinit_a-init.Tpo -c -o libinit_a-init.o
test -f 'init.c' || echo './'
init.cgcc: error: unrecognized command line option ‘-mlongcalls’
gcc: error: unrecognized command line option ‘-mtext-section-literals’; did you mean ‘-fext-numeric-literals’?
The text was updated successfully, but these errors were encountered: