diff --git a/collects/dynext/link-unit.ss b/collects/dynext/link-unit.ss index 2cbdf09a13..e9b3a94697 100644 --- a/collects/dynext/link-unit.ss +++ b/collects/dynext/link-unit.ss @@ -139,7 +139,7 @@ [(ppc-macosx ppc-darwin i386-macosx i386-darwin) (list "-bundle" "-flat_namespace" "-undefined" "suppress")] [(i386-cygwin) win-gcc-linker-flags] - [else (list "-shared")])) + [else (list "-fPIC" "-shared")])) (define (get-env-link-flags) (let ([v (or (getenv "MZSCHEME_DYNEXT_LINKER_FLAGS") diff --git a/src/configure b/src/configure index 726217fac4..2273dfd699 100755 --- a/src/configure +++ b/src/configure @@ -5389,6 +5389,7 @@ case $OS in ;; Linux) LIBS="$LIBS -rdynamic" + DYN_CFLAGS="-fPIC" # PPC: X11 librares are not found case `$UNAME -m` in ppc) @@ -11179,8 +11180,8 @@ if test "${enable_shared}" = "yes" ; then STATIC_AR="${LIBTOOLPROG} --mode=link $CC -o" ARFLAGS="" RANLIB=":" - MZLINKER="${LIBTOOLPROG} --mode=link $CC${need_gcc_static_libgcc} -rpath ${absprefix}/lib" - MREDLINKER="${LIBTOOLPROG} --mode=link $CXX${need_gcc_static_libgcc} -rpath ${absprefix}/lib" + MZLINKER="${LIBTOOLPROG} --mode=link --tag=CC $CC${need_gcc_static_libgcc} -rpath ${absprefix}/lib" + MREDLINKER="${LIBTOOLPROG} --mode=link --tag=CXX $CXX${need_gcc_static_libgcc} -rpath ${absprefix}/lib" PLAIN_CC="$CC" CC="${LIBTOOLPROG} --mode=compile --tag=CC $CC" CXX="${LIBTOOLPROG} --mode=compile --tag=CXX $CXX" diff --git a/src/mzscheme/configure.ac b/src/mzscheme/configure.ac index 012f7685f8..83de006e7d 100644 --- a/src/mzscheme/configure.ac +++ b/src/mzscheme/configure.ac @@ -518,6 +518,7 @@ case $OS in ;; Linux) LIBS="$LIBS -rdynamic" + DYN_CFLAGS="-fPIC" # PPC: X11 librares are not found case `$UNAME -m` in ppc) @@ -1192,8 +1193,8 @@ if test "${enable_shared}" = "yes" ; then STATIC_AR="${LIBTOOLPROG} --mode=link $CC -o" ARFLAGS="" RANLIB=":" - MZLINKER="${LIBTOOLPROG} --mode=link $CC${need_gcc_static_libgcc} -rpath ${absprefix}/lib" - MREDLINKER="${LIBTOOLPROG} --mode=link $CXX${need_gcc_static_libgcc} -rpath ${absprefix}/lib" + MZLINKER="${LIBTOOLPROG} --mode=link --tag=CC $CC${need_gcc_static_libgcc} -rpath ${absprefix}/lib" + MREDLINKER="${LIBTOOLPROG} --mode=link --tag=CXX $CXX${need_gcc_static_libgcc} -rpath ${absprefix}/lib" PLAIN_CC="$CC" CC="${LIBTOOLPROG} --mode=compile --tag=CC $CC" CXX="${LIBTOOLPROG} --mode=compile --tag=CXX $CXX"