Commit c6ccec50 authored by Eddie Kohler's avatar Eddie Kohler

Do not supply -rdynamic to compilers that don't support it.

parent fbe3c9cf
......@@ -655,8 +655,10 @@ EXTRA_TOOL_OBJS
EXTRA_DRIVER_OBJS
SOCKET_LIBS
BUILD_DL_LIBS
BUILD_DL_LDFLAGS
SOSUFFIX
LDMODULEFLAGS
DL_LDFLAGS
DL_LIBS
HOST_TOOLS
BUILD_RANLIB
......@@ -7359,7 +7361,7 @@ else
ac_cv_endian=0
cat > conftest.$ac_ext <<EOF
#line 7362 "configure"
#line 7364 "configure"
#include "confdefs.h"
#include <$endian_hdr>
#ifdef __BYTE_ORDER
......@@ -8478,6 +8480,33 @@ $as_echo "#define HAVE_DYNAMIC_LINKING 1" >>confdefs.h
fi
DL_LDFLAGS=
save_ldflags="$LDFLAGS"; LDFLAGS="$LDFLAGS -rdynamic"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether linker accepts the -rdynamic flag" >&5
$as_echo_n "checking whether linker accepts the -rdynamic flag... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
return 0;
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_rdynamic=yes; DL_LDFLAGS=-rdynamic
else
ac_cv_rdynamic=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_rdynamic" >&5
$as_echo "$ac_cv_rdynamic" >&6; }
LDFLAGS="$save_ldflags"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler flags for building loadable modules" >&5
$as_echo_n "checking compiler flags for building loadable modules... " >&6; }
LDMODULEFLAGS=-shared
......@@ -8564,6 +8593,34 @@ fi
if test "x$ac_build_have_dlopen" = xyes -a "x$ac_build_have_dlfcn_h" = xyes; then
ac_build_have_dynamic_linking=yes
fi
BUILD_DL_LDFLAGS=
save_ldflags="$LDFLAGS"; LDFLAGS="$LDFLAGS -rdynamic"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether linker accepts the -rdynamic flag" >&5
$as_echo_n "checking whether linker accepts the -rdynamic flag... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
return 0;
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_build_rdynamic=yes; BUILD_DL_LDFLAGS=-rdynamic
else
ac_cv_build_rdynamic=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build_rdynamic" >&5
$as_echo "$ac_cv_build_rdynamic" >&6; }
LDFLAGS="$save_ldflags"
if test "x$ac_build_have_dynamic_linking" != "x$ac_have_dynamic_linking"; then
as_fn_error $? "
=========================================
......
......@@ -214,6 +214,15 @@ AC_DEFUN([CLICK_CHECK_DYNAMIC_LINKING], [
fi
AC_SUBST(DL_LIBS)
DL_LDFLAGS=
save_ldflags="$LDFLAGS"; LDFLAGS="$LDFLAGS -rdynamic"
AC_MSG_CHECKING([whether linker accepts the -rdynamic flag])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],
[ac_cv_rdynamic=yes; DL_LDFLAGS=-rdynamic], [ac_cv_rdynamic=no])
AC_MSG_RESULT($ac_cv_rdynamic)
LDFLAGS="$save_ldflags"
AC_SUBST(DL_LDFLAGS)
AC_MSG_CHECKING(compiler flags for building loadable modules)
LDMODULEFLAGS=-shared
SOSUFFIX=so
......@@ -247,6 +256,16 @@ AC_DEFUN([CLICK_CHECK_BUILD_DYNAMIC_LINKING], [
if test "x$ac_build_have_dlopen" = xyes -a "x$ac_build_have_dlfcn_h" = xyes; then
ac_build_have_dynamic_linking=yes
fi
BUILD_DL_LDFLAGS=
save_ldflags="$LDFLAGS"; LDFLAGS="$LDFLAGS -rdynamic"
AC_MSG_CHECKING([whether linker accepts the -rdynamic flag])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],
[ac_cv_build_rdynamic=yes; BUILD_DL_LDFLAGS=-rdynamic], [ac_cv_build_rdynamic=no])
AC_MSG_RESULT($ac_cv_build_rdynamic)
LDFLAGS="$save_ldflags"
AC_SUBST(BUILD_DL_LDFLAGS)
if test "x$ac_build_have_dynamic_linking" != "x$ac_have_dynamic_linking"; then
AC_MSG_ERROR([
=========================================
......
......@@ -18,11 +18,13 @@ CC = @BUILD_CC@
CXX = @BUILD_CXX@
LIBCLICKTOOL = libclicktool_build.a
DL_LIBS = @BUILD_DL_LIBS@
DL_LDFLAGS = @BUILD_DL_LDFLAGS@
else
CC = @CC@
CXX = @CXX@
LIBCLICKTOOL = libclicktool.a
DL_LIBS = @DL_LIBS@
DL_LDFLAGS = @DL_LDFLAGS@
endif
INSTALL = @INSTALL@
mkinstalldirs = $(conf_auxdir)/mkinstalldirs
......@@ -81,7 +83,7 @@ $(LIBCLICKTOOL):
@cd ../lib; $(MAKE) $(LIBCLICKTOOL)
click-align: Makefile $(OBJS) ../lib/$(LIBCLICKTOOL)
$(call cxxlink,-rdynamic $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
$(call cxxlink,$(DL_LDFLAGS) $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
......
......@@ -18,11 +18,13 @@ CC = @BUILD_CC@
CXX = @BUILD_CXX@
LIBCLICKTOOL = libclicktool_build.a
DL_LIBS = @BUILD_DL_LIBS@
DL_LDFLAGS = @BUILD_DL_LDFLAGS@
else
CC = @CC@
CXX = @CXX@
LIBCLICKTOOL = libclicktool.a
DL_LIBS = @DL_LIBS@
DL_LDFLAGS = @DL_LDFLAGS@
endif
INSTALL = @INSTALL@
mkinstalldirs = $(conf_auxdir)/mkinstalldirs
......@@ -81,7 +83,7 @@ $(LIBCLICKTOOL):
@cd ../lib; $(MAKE) $(LIBCLICKTOOL)
click-check: Makefile $(OBJS) ../lib/$(LIBCLICKTOOL)
$(call cxxlink,-rdynamic $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
$(call cxxlink,$(DL_LDFLAGS) $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
......
......@@ -18,11 +18,13 @@ CC = @BUILD_CC@
CXX = @BUILD_CXX@
LIBCLICKTOOL = libclicktool_build.a
DL_LIBS = @BUILD_DL_LIBS@
DL_LDFLAGS = @BUILD_DL_LDFLAGS@
else
CC = @CC@
CXX = @CXX@
LIBCLICKTOOL = libclicktool.a
DL_LIBS = @DL_LIBS@
DL_LDFLAGS = @DL_LDFLAGS@
endif
INSTALL = @INSTALL@
mkinstalldirs = $(conf_auxdir)/mkinstalldirs
......@@ -82,10 +84,10 @@ $(LIBCLICKTOOL):
@cd ../lib; $(MAKE) $(LIBCLICKTOOL)
click-combine: Makefile $(OBJS) ../lib/$(LIBCLICKTOOL)
$(call cxxlink,-rdynamic $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
$(call cxxlink,$(DL_LDFLAGS) $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
click-uncombine: Makefile $(UNOBJS) ../lib/$(LIBCLICKTOOL)
$(call cxxlink,-rdynamic $(UNOBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
$(call cxxlink,$(DL_LDFLAGS) $(UNOBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
......
......@@ -18,11 +18,13 @@ CC = @BUILD_CC@
CXX = @BUILD_CXX@
LIBCLICKTOOL = libclicktool_build.a
DL_LIBS = @BUILD_DL_LIBS@
DL_LDFLAGS = @BUILD_DL_LDFLAGS@
else
CC = @CC@
CXX = @CXX@
LIBCLICKTOOL = libclicktool.a
DL_LIBS = @DL_LIBS@
DL_LDFLAGS = @DL_LDFLAGS@
endif
INSTALL = @INSTALL@
mkinstalldirs = $(conf_auxdir)/mkinstalldirs
......@@ -81,7 +83,7 @@ $(LIBCLICKTOOL):
@cd ../lib; $(MAKE) $(LIBCLICKTOOL)
click-devirtualize: Makefile $(OBJS) ../lib/$(LIBCLICKTOOL)
$(call cxxlink,-rdynamic $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
$(call cxxlink,$(DL_LDFLAGS) $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
......
......@@ -18,11 +18,13 @@ CC = @BUILD_CC@
CXX = @BUILD_CXX@
LIBCLICKTOOL = libclicktool_build.a
DL_LIBS = @BUILD_DL_LIBS@
DL_LDFLAGS = @BUILD_DL_LDFLAGS@
else
CC = @CC@
CXX = @CXX@
LIBCLICKTOOL = libclicktool.a
DL_LIBS = @DL_LIBS@
DL_LDFLAGS = @DL_LDFLAGS@
endif
INSTALL = @INSTALL@
mkinstalldirs = $(conf_auxdir)/mkinstalldirs
......@@ -81,7 +83,7 @@ $(LIBCLICKTOOL):
@cd ../lib; $(MAKE) $(LIBCLICKTOOL)
click-fastclassifier: Makefile $(OBJS) ../lib/$(LIBCLICKTOOL)
$(call cxxlink,-rdynamic $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
$(call cxxlink,$(DL_LDFLAGS) $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
......
......@@ -18,11 +18,13 @@ CC = @BUILD_CC@
CXX = @BUILD_CXX@
LIBCLICKTOOL = libclicktool_build.a
DL_LIBS = @BUILD_DL_LIBS@
DL_LDFLAGS = @BUILD_DL_LDFLAGS@
else
CC = @CC@
CXX = @CXX@
LIBCLICKTOOL = libclicktool.a
DL_LIBS = @DL_LIBS@
DL_LDFLAGS = @DL_LDFLAGS@
endif
INSTALL = @INSTALL@
mkinstalldirs = $(conf_auxdir)/mkinstalldirs
......@@ -81,7 +83,7 @@ $(LIBCLICKTOOL):
@cd ../lib; $(MAKE) $(LIBCLICKTOOL)
click-flatten: Makefile $(OBJS) ../lib/$(LIBCLICKTOOL)
$(call cxxlink,-rdynamic $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
$(call cxxlink,$(DL_LDFLAGS) $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
......
......@@ -18,11 +18,13 @@ CC = @BUILD_CC@
CXX = @BUILD_CXX@
LIBCLICKTOOL = libclicktool_build.a
DL_LIBS = @BUILD_DL_LIBS@
DL_LDFLAGS = @BUILD_DL_LDFLAGS@
else
CC = @CC@
CXX = @CXX@
LIBCLICKTOOL = libclicktool.a
DL_LIBS = @DL_LIBS@
DL_LDFLAGS = @DL_LDFLAGS@
endif
INSTALL = @INSTALL@
mkinstalldirs = $(conf_auxdir)/mkinstalldirs
......@@ -82,10 +84,10 @@ $(LIBCLICKTOOL):
@cd ../lib; $(MAKE) $(LIBCLICKTOOL)
click-install: Makefile $(OBJS) ../lib/$(LIBCLICKTOOL)
$(call cxxlink,-rdynamic $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
$(call cxxlink,$(DL_LDFLAGS) $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
click-uninstall: Makefile $(UN_OBJS) ../lib/$(LIBCLICKTOOL)
$(call cxxlink,-rdynamic $(UN_OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
$(call cxxlink,$(DL_LDFLAGS) $(UN_OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
......
......@@ -18,11 +18,13 @@ CC = @BUILD_CC@
CXX = @BUILD_CXX@
LIBCLICKTOOL = libclicktool_build.a
DL_LIBS = @BUILD_DL_LIBS@
DL_LDFLAGS = @BUILD_DL_LDFLAGS@
else
CC = @CC@
CXX = @CXX@
LIBCLICKTOOL = libclicktool.a
DL_LIBS = @DL_LIBS@
DL_LDFLAGS = @DL_LDFLAGS@
endif
INSTALL = @INSTALL@
mkinstalldirs = $(conf_auxdir)/mkinstalldirs
......@@ -81,7 +83,7 @@ $(LIBCLICKTOOL):
@cd ../lib; $(MAKE) $(LIBCLICKTOOL)
click-mkmindriver: Makefile $(OBJS) ../lib/$(LIBCLICKTOOL)
$(call cxxlink,-rdynamic $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
$(call cxxlink,$(DL_LDFLAGS) $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
......
......@@ -18,11 +18,13 @@ CC = @BUILD_CC@
CXX = @BUILD_CXX@
LIBCLICKTOOL = libclicktool_build.a
DL_LIBS = @BUILD_DL_LIBS@
DL_LDFLAGS = @BUILD_DL_LDFLAGS@
else
CC = @CC@
CXX = @CXX@
LIBCLICKTOOL = libclicktool.a
DL_LIBS = @DL_LIBS@
DL_LDFLAGS = @DL_LDFLAGS@
endif
INSTALL = @INSTALL@
mkinstalldirs = $(conf_auxdir)/mkinstalldirs
......@@ -81,7 +83,7 @@ $(LIBCLICKTOOL):
@cd ../lib; $(MAKE) $(LIBCLICKTOOL)
click-pretty: Makefile $(OBJS) ../lib/$(LIBCLICKTOOL)
$(call cxxlink,-rdynamic $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
$(call cxxlink,$(DL_LDFLAGS) $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
......
......@@ -18,11 +18,13 @@ CC = @BUILD_CC@
CXX = @BUILD_CXX@
LIBCLICKTOOL = libclicktool_build.a
DL_LIBS = @BUILD_DL_LIBS@
DL_LDFLAGS = @BUILD_DL_LDFLAGS@
else
CC = @CC@
CXX = @CXX@
LIBCLICKTOOL = libclicktool.a
DL_LIBS = @DL_LIBS@
DL_LDFLAGS = @DL_LDFLAGS@
endif
INSTALL = @INSTALL@
mkinstalldirs = $(conf_auxdir)/mkinstalldirs
......@@ -81,7 +83,7 @@ $(LIBCLICKTOOL):
@cd ../lib; $(MAKE) $(LIBCLICKTOOL)
click-undead: Makefile $(OBJS) ../lib/$(LIBCLICKTOOL)
$(call cxxlink,-rdynamic $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
$(call cxxlink,$(DL_LDFLAGS) $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
......
......@@ -18,11 +18,13 @@ CC = @BUILD_CC@
CXX = @BUILD_CXX@
LIBCLICKTOOL = libclicktool_build.a
DL_LIBS = @BUILD_DL_LIBS@
DL_LDFLAGS = @BUILD_DL_LDFLAGS@
else
CC = @CC@
CXX = @CXX@
LIBCLICKTOOL = libclicktool.a
DL_LIBS = @DL_LIBS@
DL_LDFLAGS = @DL_LDFLAGS@
endif
INSTALL = @INSTALL@
mkinstalldirs = $(conf_auxdir)/mkinstalldirs
......@@ -81,7 +83,7 @@ $(LIBCLICKTOOL):
@cd ../lib; $(MAKE) $(LIBCLICKTOOL)
click-xform: Makefile $(OBJS) ../lib/$(LIBCLICKTOOL)
$(call cxxlink,-rdynamic $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
$(call cxxlink,$(DL_LDFLAGS) $(OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
......
......@@ -18,11 +18,13 @@ CC = @BUILD_CC@
CXX = @BUILD_CXX@
LIBCLICKTOOL = libclicktool_build.a
DL_LIBS = @BUILD_DL_LIBS@
DL_LDFLAGS = @BUILD_DL_LDFLAGS@
else
CC = @CC@
CXX = @CXX@
LIBCLICKTOOL = libclicktool.a
DL_LIBS = @DL_LIBS@
DL_LDFLAGS = @DL_LDFLAGS@
endif
INSTALL = @INSTALL@
mkinstalldirs = $(conf_auxdir)/mkinstalldirs
......@@ -82,10 +84,10 @@ $(LIBCLICKTOOL):
@cd ../lib; $(MAKE) $(LIBCLICKTOOL)
click2xml: Makefile $(CLICK2XML_OBJS) ../lib/$(LIBCLICKTOOL)
$(call cxxlink,-rdynamic $(CLICK2XML_OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
$(call cxxlink,$(DL_LDFLAGS) $(CLICK2XML_OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
xml2click: Makefile $(XML2CLICK_OBJS) ../lib/$(LIBCLICKTOOL)
$(call cxxlink,-rdynamic $(XML2CLICK_OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
$(call cxxlink,$(DL_LDFLAGS) $(XML2CLICK_OBJS) ../lib/$(LIBCLICKTOOL) $(LIBS),LINK)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
......
......@@ -88,6 +88,7 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
-I$(srcdir) -I$(top_srcdir) @PROPER_INCLUDES@ @PCAP_INCLUDES@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@ `$(top_builddir)/click-buildtool --otherlibs` $(ELEMENT_LIBS)
DL_LDFLAGS = @DL_LDFLAGS@
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
......@@ -122,7 +123,7 @@ ifneq ($(MAKECMDGOALS),clean)
endif
$(DRIVER): Makefile libclick.a $(OBJS)
$(call cxxlink,-rdynamic $(OBJS) libclick.a $(LIBS),LINK)
$(call cxxlink,$(DL_LDFLAGS) $(OBJS) libclick.a $(LIBS),LINK)
libclick.a: Makefile $(LIBOBJS)
$(call verbose_cmd,$(AR_CREATE) libclick.a $(LIBOBJS),AR libclick.a)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment