Undefined reference errors in tls.c during compilation #1572

Closed
tdebaets opened this Issue Mar 31, 2016 · 13 comments

Projects

None yet

5 participants

@tdebaets

When I try to compile branch 3.0.x on CentOS 5, the compilation fails with these linker errors:

build/objs/src/main/tls.o: In function `tls_application_data':
/root/freeradius-server-3.0.x/src/main/tls.c:3295: undefined reference to `tls_error_io_log'
build/objs/src/main/tls.o: In function `tls_init_ctx':
/root/freeradius-server-3.0.x/src/main/tls.c:2654: undefined reference to `tls_error_log'
/root/freeradius-server-3.0.x/src/main/tls.c:2672: undefined reference to `tls_error_log'
/root/freeradius-server-3.0.x/src/main/tls.c:2839: undefined reference to `tls_error_log'
/root/freeradius-server-3.0.x/src/main/tls.c:2849: undefined reference to `tls_error_log'
/root/freeradius-server-3.0.x/src/main/tls.c:2663: undefined reference to `tls_error_log'
build/objs/src/main/tls.o:/root/freeradius-server-3.0.x/src/main/tls.c:2488: more undefined references to `tls_error_log' follow
build/objs/src/main/tls.o: In function `tls_handshake_send':
/root/freeradius-server-3.0.x/src/main/tls.c:760: undefined reference to `tls_error_io_log'
build/objs/src/main/tls.o: In function `tls_handshake_recv':
/root/freeradius-server-3.0.x/src/main/tls.c:681: undefined reference to `tls_error_io_log'
/root/freeradius-server-3.0.x/src/main/tls.c:716: undefined reference to `tls_error_log'
build/objs/src/main/tls.o: In function `tls_new_session':
/root/freeradius-server-3.0.x/src/main/tls.c:557: undefined reference to `tls_error_log'
build/objs/src/main/tls.o: In function `tls_new_client_session':
/root/freeradius-server-3.0.x/src/main/tls.c:506: undefined reference to `tls_error_io_log'
collect2: ld returned 1 exit status
make: *** [build/bin/local/radeapclient] Error 1

I have no clue why the linker is unable to find the tls_error_log and tls_error_io_log functions, as these are just defined in the same tls.c file. This was probably introduced by commit 8d8234b. Could someone have a look? Thanks!

@alandekok
Member

You probably need to re-run "configure".

@tdebaets
tdebaets commented Apr 1, 2016

Unfortunately that didn't help. I get the same errors after a new run of ./configure. Any other ideas?

@alandekok
Member

Hmm.. CentOS 5 is at least 6 years old, and the base distribution is 10 years old. This kind of bug isn't a high priority.

It's better to use a recent distribution than for us to track down why valid C code doesn't compile.

@alandekok alandekok closed this Apr 1, 2016
@tdebaets
tdebaets commented Apr 1, 2016

Ok, but the latest 3.0.11 release still compiles and works fine on CentOS 5. I can understand that I can't use 3.1, but shouldn't 3.0 continue to work for the sake of backwards compatibility?

@arr2036
Member
arr2036 commented Apr 1, 2016

You have done

rm -rf build
make

right?

@tdebaets
tdebaets commented Apr 1, 2016

I have just tried it and it doesn't make any difference. make clean doesn't help either.

@alandekok
Member

We don't have CentOS 5 here, and aren't inclined to install it just to fix a bug. CentOS is 10 years old, and the base RedHat OS isn't even supported by RedHat any more.

The code seems to be correct, and builds for all Linux / BSD distributions we have access to. So our inclination is to say it's a CentOS 5 bug, and to ignore it.

The larger question is why are you running such an old distribution? It costs nothing to install a recent version of CentOS, which will work.

@lytboris
lytboris commented Apr 19, 2016 edited

My FreeBSD 9.3-PRERELEASE (mid 2014) build is failed too. Actually, this seems to be a failure for radeapclient rather than tls.o itself:

Executing: /bin/sh -c gcc -Wl,-rpath,/usr/local/lib -Wl,-rpath,/usr/local/lib -o build/bin/local/radeapclient build/objs//home/lytboris/git/freeradius-server/src/modules/rlm_eap/radeapclient.o build/objs//home/lytboris/git/freeradius-server/src/main/files.o build/objs//home/lytboris/git/freeradius-server/src/main/threads.o build/objs//home/lytboris/git/freeradius-server/src/main/version.o build/objs//home/lytboris/git/freeradius-server/src/main/cb.o build/objs//home/lytboris/git/freeradius-server/src/main/tls.o -L/usr/local/lib -L build/lib/local/.libs -lfreeradius-radius -Wl,-rpath=/usr/home/lytboris/git/freeradius-server/build/lib/local//.libs -L build/lib/local/.libs -lfreeradius-server -Wl,-rpath=/usr/home/lytboris/git/freeradius-server/build/lib/local//.libs -L build/lib/local/.libs -lfreeradius-eap -Wl,-rpath=/usr/home/lytboris/git/freeradius-server/build/lib/local//.libs -lcrypto -lssl -ltalloc -lpcre -L/usr/local/lib -lexecinfo -lpthread -lreadline -lcrypto -lssl -Wl,-export-dynamic

build/objs//home/lytboris/git/freeradius-server/src/main/tls.o: In functiontls_new_client_session':
/home/lytboris/git/freeradius-server/src/main/tls.c:506: undefined reference to tls_error_io_log' build/objs//home/lytboris/git/freeradius-server/src/main/tls.o: In functiontls_new_session':`

v.3.1.x is building OK on the same server, this is v3.0.x issue.

@alandekok alandekok added a commit that referenced this issue Apr 19, 2016
@alandekok alandekok Fix #ifdef placement error. Fixes #1572
Don't wrap TLS error functions with #ifdef PSK_MAX_IDENTITY_LEN
696e40d
@mcnewton
Member
mcnewton commented Apr 19, 2016 edited

Just successfully built a clean v3.0.x HEAD on fresh install of FreeBSD 9.3-RELEASE. No problems at all, including radeapclient.

[edit: refreshed page and see @alandekok just pushed a fix, so that probably explains it... :) ]

@lytboris

Yeah, I know, I have another RELENG_10 machine with no issues. Will dig it tomorrow properly and update this thread with findings.

@lytboris

It is arr2036's 8d8234b commit that breaks build. Previous 296eeeb is OK.

@lytboris

Here you go
#1586

@arr2036 arr2036 added a commit that referenced this issue Apr 20, 2016
@alandekok @arr2036 alandekok + arr2036 Fix #ifdef placement error. Fixes #1572
Don't wrap TLS error functions with #ifdef PSK_MAX_IDENTITY_LEN
9b4c8f3
@tdebaets

Compilation on CentOS 5 is now again fine as well, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment