Skip to content
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

Build error on aarch64 & GCC toolchain (maccumulate-outgoing-args, mno-red-zone) #337

Closed
dhopf opened this issue Feb 29, 2024 · 1 comment · Fixed by #338
Closed

Build error on aarch64 & GCC toolchain (maccumulate-outgoing-args, mno-red-zone) #337

dhopf opened this issue Feb 29, 2024 · 1 comment · Fixed by #338
Assignees
Labels
bug Something isn't working

Comments

@dhopf
Copy link

dhopf commented Feb 29, 2024

My platform
NVIDIA Jetson AGX Orin Developer Kit

user@ubuntu:$ uname -a
Linux ubuntu 5.10.192-tegra #1 SMP PREEMPT Mon Feb 19 20:19:53 PST 2024 aarch64 aarch64 aarch64 GNU/Linux

user@ubuntu:$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/9/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)

The issue
Based on the discussion in our libspdm issue (#2584) - especially the reply by @steven-bellock (https://github.com/DMTF/libspdm/issues/2584#issuecomment-1964454990) -, I issued the following commands in order to build the spdm-emu project:

user@ubuntu:$ git clone https://github.com/DMTF/spdm-emu.git
[...]
user@ubuntu:$ cd spdm-emu
user@ubuntu:~/spdm-emu$ git submodule update --init --recursive
[...]
user@ubuntu:~/spdm-emu$ mkdir build
user@ubuntu:~/spdm-emu$ cd build
user@ubuntu:~/spdm-emu/build$ cmake -DARCH=aarch64 -DTOOLCHAIN=GCC -DTARGET=Release -DCRYPTO=openssl ..
-- The C compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
#########################
## Build Configuration ##
#########################
CMAKE_GENERATOR = Unix Makefiles
ARCH = aarch64
TOOLCHAIN = GCC
GCOV = OFF
TARGET = Release
CRYPTO = openssl
ENABLE_BINARY_BUILD=0; Building openssl library from source.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/conti/spdm-emu/build
user@ubuntu:~/spdm-emu/build$ make copy_sample_key
Scanning dependencies of target copy_sample_key
Built target copy_sample_key
user@ubuntu:~/spdm-emu/build$ make
Scanning dependencies of target cryptlib_openssl
[  0%] Building C object out/cryptlib_openssl.out/CMakeFiles/cryptlib_openssl.dir/cipher/aead_aes_gcm.c.o
gcc: error: unrecognized command line option ‘-maccumulate-outgoing-args’
gcc: error: unrecognized command line option ‘-mno-red-zone’
make[2]: *** [out/cryptlib_openssl.out/CMakeFiles/cryptlib_openssl.dir/build.make:63: out/cryptlib_openssl.out/CMakeFiles/cryptlib_openssl.dir/cipher/aead_aes_gcm.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:899: out/cryptlib_openssl.out/CMakeFiles/cryptlib_openssl.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Judging by @alistair23 's reply in that issue (DMTF/libspdm#2584 (comment)), -maccumulate-outgoing-args and -mno-red-zone should not even be used for the aarch64 build!?

Is my cmake command wrong, or is that a bug?
I previously used exactly the same cmake command line in my separate clone of libspdm and there the lib builds without issues.

Thanks!

steven-bellock added a commit to steven-bellock/spdm-emu that referenced this issue Mar 6, 2024
Fix DMTF#337.

Signed-off-by: Steven Bellock <[email protected]>
@steven-bellock
Copy link
Contributor

This is the same issue that the libspdm build flags had.

@steven-bellock steven-bellock self-assigned this Mar 6, 2024
@steven-bellock steven-bellock added the bug Something isn't working label Mar 6, 2024
steven-bellock added a commit that referenced this issue Mar 6, 2024
Fix #337.

Signed-off-by: Steven Bellock <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants