]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix linker errors "relocation R_X86_64_32 against .rodata"
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 12 Dec 2013 09:41:39 +0000 (01:41 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 12 Dec 2013 09:41:39 +0000 (01:41 -0800)
... "can not be used when making a shared object; recompile with -fPIC"

Caused by some libraries built without libtool in certain environments.
NP: there are other libraries in Squid built without libtool but they
    appear not to be having these linker issues at this time.

Also, fixes "undefined symbol eui64_aton" uncovered by these changes.

compat/Makefile.am
compat/eui64_aton.c
compat/eui64_aton.h
configure.ac
lib/snmplib/Makefile.am
src/Common.am
src/Makefile.am

index bbd27cb3bc2ecd78f0afe8043e51bfadc0b9c7dd..22ffcf8cddc058bc76554330b87a0161c8bb1b19 100644 (file)
@@ -9,8 +9,8 @@ include $(top_srcdir)/src/Common.am
 
 # Port Specific Configurations
 
-noinst_LIBRARIES = libcompat-squid.a
-libcompat_squid_a_SOURCES = \
+noinst_LTLIBRARIES = libcompat-squid.la
+libcompat_squid_la_SOURCES = \
        assert.cc \
        assert.h \
        cmsg.h \
@@ -23,6 +23,7 @@ libcompat_squid_a_SOURCES = \
        debug.h \
        drand48.h \
        eui64_aton.h \
+       eui64_aton.c \
        fdsetsize.h \
        getaddrinfo.h \
        getnameinfo.h \
@@ -74,7 +75,7 @@ libcompat_squid_a_SOURCES = \
        os/solaris.h \
        os/sunos.h
 
-libcompat_squid_a_LIBADD= $(LIBOBJS)
+libcompat_squid_la_LIBADD= $(LIBOBJS)
 
 check_PROGRAMS += testPreCompiler
 TESTS += testPreCompiler
index 2f1cf2d139408db12ff0f7a45015ad9328dc255a..0a0bef7fc1a010fd8e6c69fe9942c0355653ef6e 100644 (file)
@@ -77,6 +77,8 @@
 #include "squid.h"
 #include "compat/eui64_aton.h"
 
+#if SQUID_EUI64_ATON
+
 /*
  * Convert an ASCII representation of an EUI-64 to binary form.
  */
@@ -132,3 +134,5 @@ good:
 
     return (0);
 }
+
+#endif /* !SQUID_EUI64_ATON */
index 863a832e33618a7e2c4fdc70bbc3b7f4f3c9d73e..f73765a1aba448fe7925ccb356df4635ca4293ec 100644 (file)
@@ -46,6 +46,8 @@
 extern "C" {
 #endif
 
+#define SQUID_EUI64_ATON 1
+
     /**
      * Size of the ASCII representation of an EUI-64.
      */
index d88e661c0d236d752c0edad1cb7f3cf0c81739e6..4fd8209975b61475b40a3ee0c16b18376d204012 100644 (file)
@@ -1126,7 +1126,7 @@ SQUID_DEFINE_BOOL(SQUID_SNMP,${enable_snmp:=yes},
    [Define to enable SNMP monitoring of Squid])
 AM_CONDITIONAL(ENABLE_SNMP, [test "x$enable_snmp" = "xyes"])
 if test "x$enable_snmp" = "xyes"; then
-    SNMPLIB='../lib/snmplib/libsnmplib.a'
+    SNMPLIB='../lib/snmplib/libsnmplib.la'
     makesnmplib=snmplib
 fi
 AC_MSG_NOTICE([SNMP support enabled: $enable_snmp])
@@ -3016,6 +3016,7 @@ AC_CHECK_FUNCS(\
        bswap_32 \
        bswap16 \
        bswap32 \
+       eui64_aton \
        fchmod \
        getdtablesize \
        getpagesize \
@@ -3073,7 +3074,6 @@ AC_CHECK_FUNCS(\
 dnl ... and some we provide local replacements for
 AC_REPLACE_FUNCS(\
        drand48 \
-       eui64_aton \
        inet_ntop \
        inet_pton \
        initgroups \
index 391e10464a425b3879f0c11e4b5bd2d215c93b82..11a255c0eca2b429fe8d0885ae5883a73a8de672 100644 (file)
@@ -4,8 +4,8 @@
 ## 
 AM_CFLAGS = $(SQUID_CFLAGS)
 AM_CXXFLAGS = $(SQUID_CXXFLAGS)
-noinst_LIBRARIES = libsnmplib.a
-libsnmplib_a_SOURCES  = asn1.c parse.c snmp_vars.c \
+noinst_LTLIBRARIES = libsnmplib.la
+libsnmplib_la_SOURCES  = asn1.c parse.c snmp_vars.c \
        coexistance.c snmp_api.c snmp_error.c  \
        mib.c snmp_api_error.c   \
        snmp_msg.c \
index 036d501c9c8ecac804f816d915a4f6beb0a43fb9..c78fe2bd9a6f1a2c0621231800a0cee0c421bba7 100644 (file)
@@ -43,7 +43,7 @@ LIBPROFILER=
 endif
 
 ## Because compatibility is almost universal. And the link order is important.
-COMPAT_LIB = -L$(top_builddir)/compat -lcompat-squid $(LIBPROFILER)
+COMPAT_LIB = $(top_builddir)/compat/libcompat-squid.la $(LIBPROFILER)
 
 ## Some helpers are written in Perl and need the local shell defined properly
 subst_perlshell = sed -e 's,[@]PERL[@],$(PERL),g' <$(srcdir)/$@.pl.in >$@ || ($(RM) -f $@ ; exit 1)
index 191c6de5a2e1900902f28d746b56d2cafe1dfe60..8029aff9e6f9d30fc22e16027cffe8977b79b5cd 100644 (file)
@@ -922,7 +922,7 @@ DEFAULT_ERROR_DIR   = $(datadir)/errors
 # Make location configure settings available to the code
 DEFS += -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" -DDEFAULT_SQUID_DATA_DIR=\"$(datadir)\" -DDEFAULT_SQUID_CONFIG_DIR=\"$(sysconfdir)\"
 
-snmp_core.o snmp_agent.o: ../lib/snmplib/libsnmplib.a $(top_srcdir)/include/cache_snmp.h
+snmp_core.o snmp_agent.o: ../lib/snmplib/libsnmplib.la $(top_srcdir)/include/cache_snmp.h
 
 globals.cc: globals.h mk-globals-c.awk
        $(AWK) -f $(srcdir)/mk-globals-c.awk < $(srcdir)/globals.h > $@ || ($(RM) -f $@ && exit 1)