diff --git a/build_tools/build_detect_platform b/build_tools/build_detect_platform index c3fb8e3f15db51b5d4374fa62b1beadf05beaf95..59e2e461950fd7446c1d4d02932ffad38f9684a8 100755 --- a/build_tools/build_detect_platform +++ b/build_tools/build_detect_platform @@ -75,7 +75,7 @@ if test -z "$TARGET_OS"; then TARGET_OS=`uname -s` fi -COMMON_FLAGS="$COMMON_FLAGS ${CFLAGS} -fPIC" +COMMON_FLAGS="$COMMON_FLAGS ${CFLAGS}" CROSS_COMPILE= PLATFORM_CCFLAGS= PLATFORM_CXXFLAGS="$PLATFORM_CXXFLAGS ${CXXFLAGS}" @@ -174,6 +174,12 @@ if [ "$CROSS_COMPILE" = "true" -o "$FBCODE_BUILD" = "true" ]; then # Also don't need any compilation tests if compiling on fbcode true else + # do fPIC on 64 bit in non-fbcode environment + case "$TARGET_OS" in + x86_64) + PLATFORM_CXXFLAGS="$PLATFORM_CXXFLAGS -fPIC" + esac + # If -std=c++0x works, use . Otherwise use port_posix.h. $CXX $CFLAGS -std=c++0x -x c++ - -o /dev/null 2>/dev/null <