aarch64 compile error
Hello,
An error occurred when cross compiling with ARCH = aarch64 , the error message says:
aarch64/fenv.c:40:29: error: invalid initializer const fenv_t __fe_dfl_env = 0;
how can i solve it?
I suspect this is no longer an issue, since we have binaries for aarch64:
https://github.com/JuliaMath/OpenlibmBuilder/releases
Please reopen with detailed instructions on compiler version, OS, and other details if still an issue.
Still an issue:
clang -D_FORTIFY_SOURCE=2 -isystem $PREFIX/include -mmacosx-version-min=11.0 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/openlibm-0.8.0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix -fno-builtin -fno-strict-aliasing -fPIC -std=c99 -Wall -I$SRC_DIR -I$SRC_DIR/include -I$SRC_DIR/aarch64 -I$SRC_DIR/src -DASSEMBLER -D__BSD_VISIBLE -Wno-implicit-function-declaration -I$SRC_DIR/ld128 -c aarch64/fenv.c -o aarch64/fenv.c.o
errors with
aarch64/fenv.c:39:14: error: initializing 'const fenv_t' with an expression of incompatible type 'int'
const fenv_t __fe_dfl_env = 0;
More:
PR: https://github.com/conda-forge/openlibm-feedstock/pull/29
See more: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=436152&view=logs&j=ced5d8de-8227-5f3f-33a1-45cf1592c45a&t=f7bcb349-6dca-53ba-d88d-1d9963e119ba
env setup
INFO: activate_clang_osx-arm64.sh made the following environmental changes:
+AR=arm64-apple-darwin20.0.0-ar
+AS=arm64-apple-darwin20.0.0-as
+CC=arm64-apple-darwin20.0.0-clang
+CC_FOR_BUILD=$BUILD_PREFIX/bin/x86_64-apple-darwin13.4.0-clang
+CFLAGS=-ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/openlibm-0.8.0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix
+CHECKSYMS=arm64-apple-darwin20.0.0-checksyms
+CLANG=arm64-apple-darwin20.0.0-clang
+CMAKE_ARGS=-DCMAKE_AR=$BUILD_PREFIX/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_CXX_COMPILER_AR=$BUILD_PREFIX/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_C_COMPILER_AR=$BUILD_PREFIX/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_RANLIB=$BUILD_PREFIX/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_CXX_COMPILER_RANLIB=$BUILD_PREFIX/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_C_COMPILER_RANLIB=$BUILD_PREFIX/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_LINKER=$BUILD_PREFIX/bin/arm64-apple-darwin20.0.0-ld -DCMAKE_STRIP=$BUILD_PREFIX/bin/arm64-apple-darwin20.0.0-strip -DCMAKE_INSTALL_NAME_TOOL=$BUILD_PREFIX/bin/arm64-apple-darwin20.0.0-install_name_tool -DCMAKE_LIBTOOL=$BUILD_PREFIX/bin/arm64-apple-darwin20.0.0-libtool -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Users/ngam/Repos/MacOSX11.0.sdk -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_PROGRAM_PATH=$BUILD_PREFIX/bin;$PREFIX/bin -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_SYSTEM_VERSION=20.0.0
+CMAKE_PREFIX_PATH=:$PREFIX
+CONDA_BUILD_CROSS_COMPILATION=1
+CONDA_TOOLCHAIN_BUILD=x86_64-apple-darwin13.4.0
+CONDA_TOOLCHAIN_HOST=arm64-apple-darwin20.0.0
+CPPFLAGS=-D_FORTIFY_SOURCE=2 -isystem $PREFIX/include -mmacosx-version-min=11.0
+DEBUG_CFLAGS=-ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -Og -g -Wall -Wextra -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/openlibm-0.8.0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix
+HOST=arm64-apple-darwin20.0.0
+INSTALL_NAME_TOOL=arm64-apple-darwin20.0.0-install_name_tool
+LD=arm64-apple-darwin20.0.0-ld
+LDFLAGS=-Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,$PREFIX/lib -L$PREFIX/lib
+LDFLAGS_LD=-pie -headerpad_max_install_names -dead_strip_dylibs -rpath $PREFIX/lib -L$PREFIX/lib
+LIBTOOL=arm64-apple-darwin20.0.0-libtool
+LIPO=arm64-apple-darwin20.0.0-lipo
+MESON_ARGS=--buildtype release --prefix=$PREFIX -Dlibdir=lib --cross-file $BUILD_PREFIX/meson_cross_file.txt
+NM=arm64-apple-darwin20.0.0-nm
+NMEDIT=arm64-apple-darwin20.0.0-nmedit
+OBJC=arm64-apple-darwin20.0.0-clang
+OBJC_FOR_BUILD=$BUILD_PREFIX/bin/x86_64-apple-darwin13.4.0-clang
+OTOOL=arm64-apple-darwin20.0.0-otool
+PAGESTUFF=arm64-apple-darwin20.0.0-pagestuff
+RANLIB=arm64-apple-darwin20.0.0-ranlib
+REDO_PREBINDING=arm64-apple-darwin20.0.0-redo_prebinding
+SDKROOT=/Users/ngam/Repos/MacOSX11.0.sdk
+SEGEDIT=arm64-apple-darwin20.0.0-segedit
+SEG_ADDR_TABLE=arm64-apple-darwin20.0.0-seg_addr_table
+SEG_HACK=arm64-apple-darwin20.0.0-seg_hack
+SIZE=arm64-apple-darwin20.0.0-size
+STRINGS=arm64-apple-darwin20.0.0-strings
+STRIP=arm64-apple-darwin20.0.0-strip
+_CONDA_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_arm64_apple_darwin20_0_0
+ac_cv_func_malloc_0_nonnull=yes
+ac_cv_func_realloc_0_nonnull=yes
+build_alias=x86_64-apple-darwin13.4.0
+host_alias=arm64-apple-darwin20.0.0
Oddly, this does NOT happen for our linux aarch64 cross-compile. Only MacOS cross-compile.
Maybe something to do with SDK, etc.?
And, one more piece of info: Compiles totally fine natively (on mac arm64).
+build_alias=x86_64-apple-darwin13.4.0
+host_alias=arm64-apple-darwin20.0.0
When building natively, build_alias will be arm64-apple-darwin20.0.0
As @isuruf fixed it in https://github.com/conda-forge/openlibm-feedstock/pull/29/commits/f83e0bae83c4245e11c76e54e77905e5ed85d101, this seems to resolve this particular problem for osx: sed -i.bak "s/CC = clang/CC ?= clang/g" Make.inc
Please reopen if still an issue.