File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 288288
289289if [[ " -$BUILD_TYPE -" == * -static-* ]]; then
290290 _SYSROOT=" /opt/cross/Os"
291- _MARCH=" ${CROSS_ARCH:- $ARCH } "
291+ _MARCH=" ${CROSS_ARCH} "
292+ if [[ " $CROSS_ARCH " == " native" ]]; then
293+ _MARCH=" ${ARCH} "
294+ fi
292295 _TARGET=" ${_MARCH} -unknown-linux-musl"
293296 export CC=" ${_TARGET} -${CC} "
294297 export CXX=" ${_TARGET} -${CXX} "
@@ -322,7 +325,7 @@ if [[ "-$BUILD_TYPE-" == *-static-* ]]; then
322325 _sslprefix=" /opt/static-libs/$COMPILER -openssl/$_TARGET "
323326 fi
324327
325- export LDFLAGS=" ${LDFLAGS} --sysroot=$_SYSROOT -L$_staticprefix /lib -L$_SYSROOT /usr/$_TARGET /lib -lucontext"
328+ export LDFLAGS=" ${LDFLAGS} --sysroot=$_SYSROOT -static-libgcc - L$_staticprefix /lib -L$_SYSROOT /usr/$_TARGET /lib -lucontext"
326329 export CFLAGS=" ${CFLAGS} --sysroot=$_SYSROOT "
327330 export CXXFLAGS=" ${CXXFLAGS} --sysroot=$_SYSROOT "
328331 # if [[ "$ARCH" == "aarch64" ]]; then
@@ -331,7 +334,7 @@ if [[ "-$BUILD_TYPE-" == *-static-* ]]; then
331334 # fi
332335 CMAKE_ARGS=" ${CMAKE_ARGS} -DSTATIC_BUILD_DO_NOT_USE=1 -DWITH_UNIVERSAL_BINARY=1 -DWITH_FUSE_EXTRACT_BINARY=1 -DSTATIC_BUILD_EXTRA_PREFIX=$_staticprefix ;$_sslprefix ;$_jemallocprefix "
333336
334- if [[ -n " $CROSS_ARCH " ]]; then
337+ if [[ " $CROSS_ARCH " != " native " ]]; then
335338 CMAKE_ARGS=" ${CMAKE_ARGS} -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=$MARCH -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-$MARCH -DFOLLY_HAVE_UNALIGNED_ACCESS=OFF -DFOLLY_HAVE_WEAK_SYMBOLS=ON -DFOLLY_HAVE_LINUX_VDSO=OFF -DFOLLY_HAVE_WCHAR_SUPPORT=OFF -DHAVE_VSNPRINTF_ERRORS=OFF"
336339 fi
337340fi
You can’t perform that action at this time.
0 commit comments