diff options
author | wtc%google.com <devnull@localhost> | 2008-11-25 18:45:51 +0000 |
---|---|---|
committer | wtc%google.com <devnull@localhost> | 2008-11-25 18:45:51 +0000 |
commit | 38a5150419e5305fc3d67aa79bc87498b7e86453 (patch) | |
tree | cad4f21f6ce1fd7bbea45b355bd4e3afa72e2379 | |
parent | f58af72ae9f5e1a688059d46dbc1eb07f3a95924 (diff) | |
download | nspr-hg-38a5150419e5305fc3d67aa79bc87498b7e86453.tar.gz |
Bug 461502: Use -Bdirect on Solaris 10 or later. The patch is contributed
by Julien Pierre of Sun Microsystems. r=wtc.
-rwxr-xr-x | configure | 52 | ||||
-rw-r--r-- | configure.in | 14 |
2 files changed, 47 insertions, 19 deletions
@@ -4766,15 +4766,29 @@ EOF LD=/usr/ccs/bin/ld MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' RESOLVE_LINK_SYMBOLS=1 + case "${OS_RELEASE}" in + 5.8|5.9) + ;; + *) + # It is safe to use the -Bdirect linker flag on Solaris 10 or later. + USE_B_DIRECT=1 + ;; + esac if test -n "$GNU_CC"; then DSO_CFLAGS=-fPIC if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then GCC_USE_GNU_LD=1 fi DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore' + if test -n "$USE_B_DIRECT"; then + DSO_LDOPTS="$DSO_LDOPTS,-Bdirect" + fi else DSO_CFLAGS=-KPIC DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore' + if test -n "$USE_B_DIRECT"; then + DSO_LDOPTS="$DSO_LDOPTS -Bdirect" + fi fi if test -n "$GNU_CC"; then CFLAGS="$CFLAGS -Wall" @@ -5027,7 +5041,7 @@ case $target in ;; *) echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:5031: checking for dlopen in -ldl" >&5 +echo "configure:5045: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5035,7 +5049,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 5039 "configure" +#line 5053 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5046,7 +5060,7 @@ int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:5050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5063,17 +5077,17 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:5067: checking for dlfcn.h" >&5 +echo "configure:5081: checking for dlfcn.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5072 "configure" +#line 5086 "configure" #include "confdefs.h" #include <dlfcn.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5091: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5106,13 +5120,13 @@ esac if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:5110: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:5124: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext <<EOF -#line 5116 "configure" +#line 5130 "configure" #include "confdefs.h" #include <sgtty.h> Autoconf TIOCGETP @@ -5130,7 +5144,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext <<EOF -#line 5134 "configure" +#line 5148 "configure" #include "confdefs.h" #include <termio.h> Autoconf TCGETA @@ -5154,12 +5168,12 @@ fi for ac_func in lchown strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5158: checking for $ac_func" >&5 +echo "configure:5172: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5163 "configure" +#line 5177 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5182,7 +5196,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:5186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5223,7 +5237,7 @@ hpux*) if test -z "$GNU_CC"; then echo $ac_n "checking for +Olit support""... $ac_c" 1>&6 -echo "configure:5227: checking for +Olit support" >&5 +echo "configure:5241: checking for +Olit support" >&5 if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5262,7 +5276,7 @@ darwin*) *) echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:5266: checking for pthread_create in -lpthreads" >&5 +echo "configure:5280: checking for pthread_create in -lpthreads" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5284,7 +5298,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:5288: checking for pthread_create in -lpthread" >&5 +echo "configure:5302: checking for pthread_create in -lpthread" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5306,7 +5320,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:5310: checking for pthread_create in -lc_r" >&5 +echo "configure:5324: checking for pthread_create in -lc_r" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5328,7 +5342,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 -echo "configure:5332: checking for pthread_create in -lc" >&5 +echo "configure:5346: checking for pthread_create in -lc" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5460,7 +5474,7 @@ if test -n "$USE_PTHREADS"; then rm -f conftest* ac_cv_have_dash_pthread=no echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6 -echo "configure:5464: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:5478: checking whether ${CC-cc} accepts -pthread" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then @@ -5483,7 +5497,7 @@ echo "configure:5464: checking whether ${CC-cc} accepts -pthread" >&5 ac_cv_have_dash_pthreads=no if test "$ac_cv_have_dash_pthread" = "no"; then echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6 -echo "configure:5487: checking whether ${CC-cc} accepts -pthreads" >&5 +echo "configure:5501: checking whether ${CC-cc} accepts -pthreads" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then diff --git a/configure.in b/configure.in index bd3fc97c..73562d3b 100644 --- a/configure.in +++ b/configure.in @@ -1989,15 +1989,29 @@ mips-sony-newsos*) LD=/usr/ccs/bin/ld MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' RESOLVE_LINK_SYMBOLS=1 + case "${OS_RELEASE}" in + 5.8|5.9) + ;; + *) + # It is safe to use the -Bdirect linker flag on Solaris 10 or later. + USE_B_DIRECT=1 + ;; + esac if test -n "$GNU_CC"; then DSO_CFLAGS=-fPIC if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then GCC_USE_GNU_LD=1 fi DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore' + if test -n "$USE_B_DIRECT"; then + DSO_LDOPTS="$DSO_LDOPTS,-Bdirect" + fi else DSO_CFLAGS=-KPIC DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore' + if test -n "$USE_B_DIRECT"; then + DSO_LDOPTS="$DSO_LDOPTS -Bdirect" + fi fi if test -n "$GNU_CC"; then CFLAGS="$CFLAGS -Wall" |