diff --git a/configure b/configure index 859338c4..9e832fb3 100755 --- a/configure +++ b/configure @@ -253,7 +253,7 @@ if [ $? -eq 0 ]; then fi fi if [ $? -eq 0 ]; then - check_compiler_flag "p,-D_FORTIFY_SOURCE=2" W + check_compiler_flag "_FORTIFY_SOURCE=2" D CPPFLAGS fi check_compiler_flag "visibility=default" f SHAREDLIB_CFLAGS if [ $? -eq 0 ]; then @@ -264,6 +264,13 @@ check_compiler_flag "std=c99" "" CFLAGS check_compiler_flag "l,--as-needed" W LDFLAGS check_compiler_flag "O2" "" CFLAGS check_compiler_flag "pipe" "" CFLAGS +# +# Check for -Wl,--export-dynamic and if it fails, try -rdynamic. +# +check_compiler_flag "l,--export-dynamic" W LIBXBPS_LDFLAGS +if [ $? -ne 0 ]; then + check_compiler_flag dynamic r LIBXBPS_LDFLAGS +fi # # Check if -fPIE and -pie are supported if --build-pie is set. diff --git a/lib/Makefile b/lib/Makefile index 5833efc7..751bbb41 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -4,7 +4,7 @@ LIBXBPS_MAJOR = 0 LIBXBPS_MINOR = 0 LIBXBPS_MICRO = 0 LIBXBPS_SHLIB = libxbps.so.$(LIBXBPS_MAJOR).$(LIBXBPS_MINOR).$(LIBXBPS_MICRO) -LDFLAGS += -Wl,--export-dynamic -shared -Wl,-soname,libxbps.so.$(LIBXBPS_MAJOR) +LDFLAGS += $(LIBXBPS_LDFLAGS) -shared -Wl,-soname,libxbps.so.$(LIBXBPS_MAJOR) # portableproplib LIBPROP_OBJS = portableproplib/prop_array.o portableproplib/prop_bool.o