llvm.org GIT mirror llvm / dcf114e
Enable -fvisibility-inlines-hidden by default for compilers which support it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55557 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 11 years ago
5 changed file(s) with 148 addition(s) and 25 deletion(s). Raw diff Collapse all Expand all
233233 # Do we want to build with position independent code?
234234 ENABLE_PIC := @ENABLE_PIC@
235235
236 # Use -fvisibility-inlines-hidden?
237 ENABLE_VISIBILITY_INLINES_HIDDEN := @ENABLE_VISIBILITY_INLINES_HIDDEN@
238
236239 # This option tells the Makefiles to produce verbose output.
237240 # It essentially prints the commands that make is executing
238241 #VERBOSE = 1
238238 LD.Flags += -g
239239 KEEP_SYMBOLS := 1
240240 endif
241 endif
242
243 ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1)
244 CXX.Flags += -fvisibility-inlines-hidden
241245 endif
242246
243247 # IF REQUIRES_EH=1 is specified then don't disable exceptions
974974 AC_MSG_ERROR([Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings.])
975975 fi
976976
977 dnl Determine if the compiler supports -fvisibility-inlines-hidden.
978 AC_CXX_USE_VISIBILITY_INLINES_HIDDEN
977979
978980 dnl===-----------------------------------------------------------------------===
979981 dnl===
0 #
1 # Determine if the compiler accepts -fvisibility-inlines-hidden
2 #
3 # This macro is specific to LLVM.
4 #
5 AC_DEFUN([AC_CXX_USE_VISIBILITY_INLINES_HIDDEN],
6 [AC_CACHE_CHECK([for compiler -fvisibility-inlines-hidden option],
7 [llvm_cv_cxx_visibility_inlines_hidden],
8 [ AC_LANG_PUSH([C++])
9 oldcxxflags="$CXXFLAGS"
10 CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
11 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
12 [llvm_cv_cxx_visibility_inlines_hidden=yes],[llvm_cv_cxx_visibility_inlines_hidden=no])
13 CXXFLAGS="$oldcxxflags"
14 AC_LANG_POP([C++])
15 ])
16 if test "$llvm_cv_cxx_visibility_inlines_hidden" = yes ; then
17 AC_SUBST([ENABLE_VISIBILITY_INLINES_HIDDEN],[1])
18 else
19 AC_SUBST([ENABLE_VISIBILITY_INLINES_HIDDEN],[0])
20 fi
21 ])
927927 BINDINGS_TO_BUILD
928928 ALL_BINDINGS
929929 OCAML_LIBDIR
930 ENABLE_VISIBILITY_INLINES_HIDDEN
930931 LIBOBJS
931932 LTLIBOBJS'
932933 ac_subst_files=''
1064510646 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1064610647 lt_status=$lt_dlunknown
1064710648 cat > conftest.$ac_ext <
10648 #line 10649 "configure"
10649 #line 10650 "configure"
1064910650 #include "confdefs.h"
1065010651
1065110652 #if HAVE_DLFCN_H
1278912790 ;;
1279012791 *-*-irix6*)
1279112792 # Find out which ABI we are using.
12792 echo '#line 12793 "configure"' > conftest.$ac_ext
12793 echo '#line 12794 "configure"' > conftest.$ac_ext
1279312794 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
1279412795 (eval $ac_compile) 2>&5
1279512796 ac_status=$?
1450714508 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1450814509 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1450914510 -e 's:$: $lt_compiler_flag:'`
14510 (eval echo "\"\$as_me:14511: $lt_compile\"" >&5)
14511 (eval echo "\"\$as_me:14512: $lt_compile\"" >&5)
1451114512 (eval "$lt_compile" 2>conftest.err)
1451214513 ac_status=$?
1451314514 cat conftest.err >&5
14514 echo "$as_me:14515: \$? = $ac_status" >&5
14515 echo "$as_me:14516: \$? = $ac_status" >&5
1451514516 if (exit $ac_status) && test -s "$ac_outfile"; then
1451614517 # The compiler can only warn and ignore the option if not recognized
1451714518 # So say no if there are warnings other than the usual output.
1477514776 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1477614777 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1477714778 -e 's:$: $lt_compiler_flag:'`
14778 (eval echo "\"\$as_me:14779: $lt_compile\"" >&5)
14779 (eval echo "\"\$as_me:14780: $lt_compile\"" >&5)
1477914780 (eval "$lt_compile" 2>conftest.err)
1478014781 ac_status=$?
1478114782 cat conftest.err >&5
14782 echo "$as_me:14783: \$? = $ac_status" >&5
14783 echo "$as_me:14784: \$? = $ac_status" >&5
1478314784 if (exit $ac_status) && test -s "$ac_outfile"; then
1478414785 # The compiler can only warn and ignore the option if not recognized
1478514786 # So say no if there are warnings other than the usual output.
1487914880 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1488014881 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1488114882 -e 's:$: $lt_compiler_flag:'`
14882 (eval echo "\"\$as_me:14883: $lt_compile\"" >&5)
14883 (eval echo "\"\$as_me:14884: $lt_compile\"" >&5)
1488314884 (eval "$lt_compile" 2>out/conftest.err)
1488414885 ac_status=$?
1488514886 cat out/conftest.err >&5
14886 echo "$as_me:14887: \$? = $ac_status" >&5
14887 echo "$as_me:14888: \$? = $ac_status" >&5
1488714888 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1488814889 then
1488914890 # The compiler can only warn and ignore the option if not recognized
1733117332 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1733217333 lt_status=$lt_dlunknown
1733317334 cat > conftest.$ac_ext <
17334 #line 17335 "configure"
17335 #line 17336 "configure"
1733517336 #include "confdefs.h"
1733617337
1733717338 #if HAVE_DLFCN_H
1743117432 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1743217433 lt_status=$lt_dlunknown
1743317434 cat > conftest.$ac_ext <
17434 #line 17435 "configure"
17435 #line 17436 "configure"
1743517436 #include "confdefs.h"
1743617437
1743717438 #if HAVE_DLFCN_H
1979919800 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1980019801 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1980119802 -e 's:$: $lt_compiler_flag:'`
19802 (eval echo "\"\$as_me:19803: $lt_compile\"" >&5)
19803 (eval echo "\"\$as_me:19804: $lt_compile\"" >&5)
1980319804 (eval "$lt_compile" 2>conftest.err)
1980419805 ac_status=$?
1980519806 cat conftest.err >&5
19806 echo "$as_me:19807: \$? = $ac_status" >&5
19807 echo "$as_me:19808: \$? = $ac_status" >&5
1980719808 if (exit $ac_status) && test -s "$ac_outfile"; then
1980819809 # The compiler can only warn and ignore the option if not recognized
1980919810 # So say no if there are warnings other than the usual output.
1990319904 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1990419905 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1990519906 -e 's:$: $lt_compiler_flag:'`
19906 (eval echo "\"\$as_me:19907: $lt_compile\"" >&5)
19907 (eval echo "\"\$as_me:19908: $lt_compile\"" >&5)
1990719908 (eval "$lt_compile" 2>out/conftest.err)
1990819909 ac_status=$?
1990919910 cat out/conftest.err >&5
19910 echo "$as_me:19911: \$? = $ac_status" >&5
19911 echo "$as_me:19912: \$? = $ac_status" >&5
1991119912 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1991219913 then
1991319914 # The compiler can only warn and ignore the option if not recognized
2147321474 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2147421475 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2147521476 -e 's:$: $lt_compiler_flag:'`
21476 (eval echo "\"\$as_me:21477: $lt_compile\"" >&5)
21477 (eval echo "\"\$as_me:21478: $lt_compile\"" >&5)
2147721478 (eval "$lt_compile" 2>conftest.err)
2147821479 ac_status=$?
2147921480 cat conftest.err >&5
21480 echo "$as_me:21481: \$? = $ac_status" >&5
21481 echo "$as_me:21482: \$? = $ac_status" >&5
2148121482 if (exit $ac_status) && test -s "$ac_outfile"; then
2148221483 # The compiler can only warn and ignore the option if not recognized
2148321484 # So say no if there are warnings other than the usual output.
2157721578 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2157821579 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2157921580 -e 's:$: $lt_compiler_flag:'`
21580 (eval echo "\"\$as_me:21581: $lt_compile\"" >&5)
21581 (eval echo "\"\$as_me:21582: $lt_compile\"" >&5)
2158121582 (eval "$lt_compile" 2>out/conftest.err)
2158221583 ac_status=$?
2158321584 cat out/conftest.err >&5
21584 echo "$as_me:21585: \$? = $ac_status" >&5
21585 echo "$as_me:21586: \$? = $ac_status" >&5
2158521586 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2158621587 then
2158721588 # The compiler can only warn and ignore the option if not recognized
2381223813 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2381323814 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2381423815 -e 's:$: $lt_compiler_flag:'`
23815 (eval echo "\"\$as_me:23816: $lt_compile\"" >&5)
23816 (eval echo "\"\$as_me:23817: $lt_compile\"" >&5)
2381623817 (eval "$lt_compile" 2>conftest.err)
2381723818 ac_status=$?
2381823819 cat conftest.err >&5
23819 echo "$as_me:23820: \$? = $ac_status" >&5
23820 echo "$as_me:23821: \$? = $ac_status" >&5
2382023821 if (exit $ac_status) && test -s "$ac_outfile"; then
2382123822 # The compiler can only warn and ignore the option if not recognized
2382223823 # So say no if there are warnings other than the usual output.
2408024081 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2408124082 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2408224083 -e 's:$: $lt_compiler_flag:'`
24083 (eval echo "\"\$as_me:24084: $lt_compile\"" >&5)
24084 (eval echo "\"\$as_me:24085: $lt_compile\"" >&5)
2408424085 (eval "$lt_compile" 2>conftest.err)
2408524086 ac_status=$?
2408624087 cat conftest.err >&5
24087 echo "$as_me:24088: \$? = $ac_status" >&5
24088 echo "$as_me:24089: \$? = $ac_status" >&5
2408824089 if (exit $ac_status) && test -s "$ac_outfile"; then
2408924090 # The compiler can only warn and ignore the option if not recognized
2409024091 # So say no if there are warnings other than the usual output.
2418424185 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2418524186 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2418624187 -e 's:$: $lt_compiler_flag:'`
24187 (eval echo "\"\$as_me:24188: $lt_compile\"" >&5)
24188 (eval echo "\"\$as_me:24189: $lt_compile\"" >&5)
2418824189 (eval "$lt_compile" 2>out/conftest.err)
2418924190 ac_status=$?
2419024191 cat out/conftest.err >&5
24191 echo "$as_me:24192: \$? = $ac_status" >&5
24192 echo "$as_me:24193: \$? = $ac_status" >&5
2419224193 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2419324194 then
2419424195 # The compiler can only warn and ignore the option if not recognized
3426234263 { { echo "$as_me:$LINENO: error: Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings." >&5
3426334264 echo "$as_me: error: Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings." >&2;}
3426434265 { (exit 1); exit 1; }; }
34266 fi
34267
34268 { echo "$as_me:$LINENO: checking for compiler -fvisibility-inlines-hidden option" >&5
34269 echo $ECHO_N "checking for compiler -fvisibility-inlines-hidden option... $ECHO_C" >&6; }
34270 if test "${llvm_cv_cxx_visibility_inlines_hidden+set}" = set; then
34271 echo $ECHO_N "(cached) $ECHO_C" >&6
34272 else
34273 ac_ext=cpp
34274 ac_cpp='$CXXCPP $CPPFLAGS'
34275 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
34276 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
34277 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
34278
34279 oldcxxflags="$CXXFLAGS"
34280 CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
34281 cat >conftest.$ac_ext <<_ACEOF
34282 /* confdefs.h. */
34283 _ACEOF
34284 cat confdefs.h >>conftest.$ac_ext
34285 cat >>conftest.$ac_ext <<_ACEOF
34286 /* end confdefs.h. */
34287
34288 int
34289 main ()
34290 {
34291
34292 ;
34293 return 0;
34294 }
34295 _ACEOF
34296 rm -f conftest.$ac_objext
34297 if { (ac_try="$ac_compile"
34298 case "(($ac_try" in
34299 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
34300 *) ac_try_echo=$ac_try;;
34301 esac
34302 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
34303 (eval "$ac_compile") 2>conftest.er1
34304 ac_status=$?
34305 grep -v '^ *+' conftest.er1 >conftest.err
34306 rm -f conftest.er1
34307 cat conftest.err >&5
34308 echo "$as_me:$LINENO: \$? = $ac_status" >&5
34309 (exit $ac_status); } &&
34310 { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
34311 { (case "(($ac_try" in
34312 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
34313 *) ac_try_echo=$ac_try;;
34314 esac
34315 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
34316 (eval "$ac_try") 2>&5
34317 ac_status=$?
34318 echo "$as_me:$LINENO: \$? = $ac_status" >&5
34319 (exit $ac_status); }; } &&
34320 { ac_try='test -s conftest.$ac_objext'
34321 { (case "(($ac_try" in
34322 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
34323 *) ac_try_echo=$ac_try;;
34324 esac
34325 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
34326 (eval "$ac_try") 2>&5
34327 ac_status=$?
34328 echo "$as_me:$LINENO: \$? = $ac_status" >&5
34329 (exit $ac_status); }; }; then
34330 llvm_cv_cxx_visibility_inlines_hidden=yes
34331 else
34332 echo "$as_me: failed program was:" >&5
34333 sed 's/^/| /' conftest.$ac_ext >&5
34334
34335 llvm_cv_cxx_visibility_inlines_hidden=no
34336 fi
34337
34338 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
34339 CXXFLAGS="$oldcxxflags"
34340 ac_ext=c
34341 ac_cpp='$CPP $CPPFLAGS'
34342 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
34343 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
34344 ac_compiler_gnu=$ac_cv_c_compiler_gnu
34345
34346
34347 fi
34348 { echo "$as_me:$LINENO: result: $llvm_cv_cxx_visibility_inlines_hidden" >&5
34349 echo "${ECHO_T}$llvm_cv_cxx_visibility_inlines_hidden" >&6; }
34350 if test "$llvm_cv_cxx_visibility_inlines_hidden" = yes ; then
34351 ENABLE_VISIBILITY_INLINES_HIDDEN=1
34352
34353 else
34354 ENABLE_VISIBILITY_INLINES_HIDDEN=0
34355
3426534356 fi
3426634357
3426734358
3518835279 BINDINGS_TO_BUILD!$BINDINGS_TO_BUILD$ac_delim
3518935280 ALL_BINDINGS!$ALL_BINDINGS$ac_delim
3519035281 OCAML_LIBDIR!$OCAML_LIBDIR$ac_delim
35282 ENABLE_VISIBILITY_INLINES_HIDDEN!$ENABLE_VISIBILITY_INLINES_HIDDEN$ac_delim
3519135283 LIBOBJS!$LIBOBJS$ac_delim
3519235284 LTLIBOBJS!$LTLIBOBJS$ac_delim
3519335285 _ACEOF
3519435286
35195 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 77; then
35287 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 78; then
3519635288 break
3519735289 elif $ac_last_try; then
3519835290 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5