Skip to content

XCC compile failed on APL/CNL #75

Closed

Description

@zhuqingliang

This issue is caused by commit : 17c929e

Reproduce Steps:
./script/xtensa-build-all.sh

error message:
checking whether the C compiler works... no
configure: error: in `/home/user/workspace/reef/sof':
configure: error: C compiler cannot create executables

Activity

  1. xiulipan commented on Jul 10, 2018

    @xiulipan
    Contributor

    bisect to #67
    In configure file the compiler check macro is not replaced with AM_* flags and compiler check in configure will fail.

    ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'

  2. jajanusz commented on Jul 10, 2018

    @jajanusz
    Contributor

    It works for APL/CNL for me. Please try setting SUPPORTED_PLATFORMS=(apl cnl) in scripts/xtensa-build-all.sh and let me know what you get. Thanks

  3. keqiaozhang commented on Jul 10, 2018

    @keqiaozhang
    Collaborator

    @jajanusz
    Still not working with exit 77. The config.log is attached.
    config.log

  4. jajanusz commented on Jul 10, 2018

    @jajanusz
    Contributor

    @keqiaozhang
    Looks like script didn't set XCC, XTOBJCOPY, XTOBJDUMP variables.
    Do you have XTENSA_TOOLS_ROOT variable set to directory that has directory structure as expected by script? With folders like:

    .
    └── install
        ├── builds
        │   ├── RF-2016.4-linux
        │   └── RG-2017.8-linux
        └── tools
            ├── RF-2016.4-linux
            └── RG-2017.8-linux
    
  5. jajanusz commented on Jul 10, 2018

    @jajanusz
    Contributor

    @keqiaozhang
    Also please let me know if it builds for you without script with something like:

    ./autogen.sh
    ./configure --with-arch=xtensa --with-platform=apollolake --with-dsp-core=$XTENSA_CORE --with-root-dir=$CONFIG_PATH/xtensa-elf --host=xtensa-bxt-elf --with-meu=$MEU_PATH --with-key=$PRIVATE_KEY_PATH CC=xt-xcc OBJCOPY=xt-objcopy OBJDUMP=xt-objdump
    make
    make bin
    

    With properly set variables of course.

  6. keqiaozhang commented on Jul 10, 2018

    @keqiaozhang
    Collaborator

    @jajanusz
    I have set the XTENSA_TOOLS_ROOT, but nothing help.
    $ ./configure --with-arch=xtensa --with-platform=cannonlake --with-root-dir=/home/zhangke/xtensa/XtDevTools//install/builds/RF-2016.4-linux/X6H3CNL_2016_4_linux/xtensa-elf --host=xtensa-cnl-elf CC=xt-xcc OBJCOPY=xt-objcopy OBJDUMP=xt-objdump --with-dsp-core=X6H3CNL_2016_4_linux

  7. jajanusz commented on Jul 10, 2018

    @jajanusz
    Contributor

    Can you send config.log for your last command, where you manually set CC=xt-xcc?

  8. jajanusz commented on Jul 10, 2018

    @jajanusz
    Contributor

    I think it's not a problem directly caused by flags (it should pass even with no flags), if you think otherwise you can test it with changing CFLAGS to whatever you think should be there. Do it before autoconf checks first time for compiler, what is probably there:

    AC_CHECK_LIB(cmocka, _cmocka_run_group_tests, [HAVE_CMOCKA_PKG=yes])

    C compiler is not checked with AC_PROG_CC, as this comment says:

    # Test after CFLAGS set othewise test of cross compiler fails.

    So changing flags before it will not help you.

    You can also pass flags to configure scripts like:

    ./configure CFLAGS="<your flags>" ...
    

    Note however that flags from top of configure (-O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes) will be added at end - this is one of the reasons why we need to change configure/makefiles to let user set his CFLAGS like it's supposed to be.

    Let me know if chagning CFLAGS helped you, so I'll make patch to make it work for everyone.
    Also please send me logs.
    Thanks

  9. keqiaozhang commented on Jul 11, 2018

    @keqiaozhang
    Collaborator

    @jajanusz
    I verified the latest code base this morning, now only APL can pass the compilation with xcc. but CNL, this issue is still exists. Please help to address it.
    config.log

  10. keqiaozhang commented on Jul 11, 2018

    @keqiaozhang
    Collaborator

    @jajanusz
    Reconfirm the case on CNL. From the config.log you can see that we miss some xtensa config of CNL for xt-xcc. Will retest after get the right version xt-xcc config for CNL.

  11. jajanusz commented on Jul 11, 2018

    @jajanusz
    Contributor

    It looks like problem with your installation/config. I have the same core as yours.
    Your log says what error is:

    You need to either specify the name of a registered Xtensa core (with
    the --xtensa-core option or the XTENSA_CORE environment variable) or
    specify a different registry of Xtensa cores (with the --xtensa-system
    option or the XTENSA_SYSTEM environment variable).
    configure:3729: $? = 2
    configure:3718: xt-xcc -v >&5
    Error: there is no Xtensa core registered as the default.
    

    You can for example just set env variable like:

    export XTENSA_CORE=X6H3CNL_2016_4_linux
    

    Let me know if it helps.
    Thanks

  12. keqiaozhang commented on Jul 11, 2018

    @keqiaozhang
    Collaborator

    @jajanusz
    Thanks, we have root caused this bug, it's because we don't have X6H3CNL_2016_4_linux, our developer is working on it.

  13. keqiaozhang commented on Jul 12, 2018

    @keqiaozhang
    Collaborator

    summary:
    The compilation issue is caused by 17c929e and both gcc and xcc cannot work.

    1. gcc compilation issue: let's track it with GCC compilation broken - again #78
    2. xcc compilation issue: now we only support APL and CNL platform. For APL, this issue is fixed by Jajanusz, commit ID:de100b7d2823e0496a0cad055625063204d0d585. For CNL, it's because we miss build "X6H3CNL_2016_4_linux". so this issue can close now and track the xcc issue on CNL with XCC compile failed on CNL #93
  14. changed the title [-]can not make firmware [/-] [+]XCC compile failed on APL/CNL[/+] on Jul 12, 2018
  15. keqiaozhang commented on Jul 20, 2018

    @keqiaozhang
    Collaborator

    This issue is fixed by #77.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working as expected

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions