[OpenSER-Devel] [ openser-Bugs-1759216 ] ACC Linkage Failure

SourceForge.net noreply at sourceforge.net
Tue Jul 24 14:01:56 CEST 2007


Bugs item #1759216, was opened at 2007-07-24 00:51
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1759216&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: ver devel
Status: Open
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Norm Brandinger (norm_brandinger)
>Assigned to: Bogdan (bogdan_iancu)
Summary: ACC Linkage Failure

Initial Comment:
The latest SVN produces the following error (at the bottom).  Commented the RADIUS integration and the same linkage error happens.

Compiling diam_tcp.c
gcc -DMOD_NAME='"acc"'    -DNAME='"openser"' -DVERSION='"1.3.0-dev7-notls"' -DARCH='"x86_64"' -DOS='"linux"' -DCOMPILER='"gcc 4.1.2"' -D__CPU_x86_64 -D__OS_linux -D__SMP_yes -DCFG_DIR='"/usr/local/etc/openser/"' -DPKG_MALLOC -DSHM_MEM  -DSHM_MMAP -DUSE_IPV6 -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DSTATISTICS -DF_MALLOC -DCHANGEABLE_DEBUG_LEVEL  -DSVNREVISION='"2:2502M"'  -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024  -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_EPOLL -DHAVE_SIGIO_RT -DHAVE_SELECT -DSQL_ACC -DRAD_ACC -I/usr/local/include -c diam_tcp.c -o diam_tcp.o
Linking acc.so
gcc -shared  -Wl,-O2 -Wl,-E    acc.o acc_extra.o acc_logic.o acc_mod.o diam_avp.o diam_message.o diam_tcp.o  -L/usr/local/lib -lradiusclient-ng -o acc.so 
/usr/bin/ld: acc.o: relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
acc.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [acc.so] Error 1

----------------------------------------------------------------------

>Comment By: Bogdan (bogdan_iancu)
Date: 2007-07-24 15:01

Message:
Logged In: YES 
user_id=1275325
Originator: NO

Actually the module specific flags are missing (Dan is right) - they were
lost when I added last week the MOD_NAME variable used by the logging
function.
It should be fixed on SVN.

Thanks and regards,
Bogdan

----------------------------------------------------------------------

Comment By: Dan (dan_pascu)
Date: 2007-07-24 14:37

Message:
Logged In: YES 
user_id=1296758
Originator: NO

The compiler flags are missing. When compiling modules under opense-1.1.x
we had these flags right after the gcc command:

 -fPIC -DPIC -g -O9 -funroll-loops -Wcast-align -Wall -Wno-strict-aliasing
-minline-all-stringops -falign-loops -ftree-vectorize
 -mtune=athlon64

Now they are nowhere to be seen when compiling the trunk version. The
relevant one for this error is -fPIC, because that is needed when compiling
a dynamically loadable module, and the compiler correctly gives a notice
about it not being present. Why it doesn't error under i386 is a mistery,
not the norm. Also without -Ox the code is not optimized at all. I suspect
some error in the makefiles have resulted in the flags being left out.

And while we're at this, I have to raise 3 issues:

1. Why do I get the -mtune=athlon64 option on a 32 bit Intel CPU?

2. The gcc manual says this for the -shared option:

    -shared
       Produce a shared object which can then be linked with other
objects
       to form an executable.  Not all systems support this option.  For
       predictable results, you must also specify the same set of options
       that were used to generate code (-fpic, -fPIC, or model
suboptions)
       when you specify this option.[1]

   I see that when linking we do not specify the same -fPIC option along
with -shared.

3. I cannot control CFLAGS. In Makefile.defs is computed like this:

   CFLAGS=$(shell echo "$${CFLAGS}")
   ...
   CFLAGS+=-g -O9 -funroll-loops ...

Now assume I want -O2 and specify CFLAGS="-O2" make
What I get is:
 gcc -O2 -g -O9 -funroll-loops ...
and -O9 is used instead of -O2 because it comes latter.
The user defined CFLAGS should be added at the end of the constructed
CFLAGS, not at the beginning.
Even better, do not overwrite/modify CFLAGS. Instead build some internal
flags variable, say OPENSER_FLAGS, and later call

gcc $(OPENSER_FLAGS) $(CFLAGS)



----------------------------------------------------------------------

Comment By: Norm Brandinger (norm_brandinger)
Date: 2007-07-24 14:10

Message:
Logged In: YES 
user_id=1786021
Originator: YES

I did run a test with RADIUS turned off.  The same link error was raised. 
Below is the output without RADIUS.  It is interesting to note that
Diameter modules appear to be compiling even though it wasn't turned on in
the acc/Makefile.

I'm using radiusclient-ng-0.5.2 because of a problem generating hash codes
on 64-bit machines.  Don't know if more current versions of radiusclient-ng
have this problem fixed. 

Regards,
Norm


gcc -DMOD_NAME='"acc"'    -DNAME='"openser"'
-DVERSION='"1.3.0-dev7-notls"' -DARCH='"x86_64"' -DOS='"linux"'
-DCOMPILER='"gcc 4.1.2"' -D__CPU_x86_64 -D__OS_linux -D__SMP_yes
-DCFG_DIR='"/usr/local/etc/openser/"' -DPKG_MALLOC -DSHM_MEM  -DSHM_MMAP
-DUSE_IPV6 -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES
-DSTATISTICS -DF_MALLOC -DCHANGEABLE_DEBUG_LEVEL  -DSVNREVISION='"2:2502M"'
 -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 
-DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD
-DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM
-DHAVE_EPOLL -DHAVE_SIGIO_RT -DHAVE_SELECT -DSQL_ACC -c diam_tcp.c -o
diam_tcp.o
Linking acc.so
gcc -shared  -Wl,-O2 -Wl,-E    acc.o acc_extra.o acc_logic.o acc_mod.o
diam_avp.o diam_message.o diam_tcp.o   -o acc.so 
/usr/bin/ld: acc.o: relocation R_X86_64_32S against `a local symbol' can
not be used when making a shared object; recompile with -fPIC
acc.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [acc.so] Error 1

----------------------------------------------------------------------

Comment By: Henning Westerholt (henningw)
Date: 2007-07-24 13:29

Message:
Logged In: YES 
user_id=337916
Originator: NO

Hello Norman,

i was unfortunally not able to reproduce this on my machine. It must be a
x86_64 specific problem. Do you use the libradius-ng package provided from
the debian repository? Is this a 32 bit or 64 bit version?

Cheers,

Henning

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1759216&group_id=139143



More information about the Devel mailing list