Project

General

Profile

Bug #2752

vector_realloc missing when linking test_configfile

Added by petrs 10 months ago. Updated 10 months ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
build_autotools
Target version:
Start date:
2016-09-21
Due date:
% Done:

100%

Estimated time:
Missing in 1.5.x:

Description

When building lighttpd 1.4.41 (on Solaris sparc) with Solaris studio compiler it fails:

..
/bin/bash ../libtool --tag=CC --mode=link /ws/on12-tools/SUNWspro/solarisstudio12.4/bin/cc -m64 -xO4 -xtarget=ultra2 -xarch=sparcvis -xchip=ultra2 -Qoption cg -xregs=no%appl -W2,-xwrap_int -xmemalign=16s -mt -I/usr/include/openldap -lldap_r-2.4 -o test_configfile test_configfile.o buffer.o array.o data_string.o keyvalue.o log.o -L/usr/lib/sparcv9 -R/usr/lib/sparcv9 -lpcre -lresolv
libtool: link: /ws/on12-tools/SUNWspro/solarisstudio12.4/bin/cc -m64 -xO4 -xtarget=ultra2 -xarch=sparcvis -xchip=ultra2 -Qoption cg -xregs=no%appl -W2,-xwrap_int -xmemalign=16s -mt -I/usr/include/openldap -o test_configfile test_configfile.o buffer.o array.o data_string.o keyvalue.o log.o -lldap_r-2.4 -L/usr/lib/sparcv9 -lpcre -lresolv -mt -R/usr/lib/sparcv9
Undefined first referenced
symbol in file
vector_realloc test_configfile.o
ld: fatal: symbol referencing errors

Please note that it succeed with gcc.

Following is info from Solaris Studio expert:

Two functions call each other:
vector_config_weak_push
vector_config_weak_reserve
But are otherwise uncalled.

One of them calls vector_realloc, which is undefined.

gcc is smart enough to remove the first two functions
because they are never called except from each other.
Therefore, the unresolved external is never manifested,
even though it's a bug in the code as written.

Because Studio cc generates the code, you see an
unresolved reference.


And here is possible fix:

--- src/Makefile.in
++ src/Makefile.in
@ -585,7 +585,7 @
test_buffer_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_test_configfile_OBJECTS = test_configfile.$(OBJEXT) \
buffer.$(OBJEXT) array.$(OBJEXT) data_string.$(OBJEXT) \
- keyvalue.$(OBJEXT) log.$(OBJEXT)
keyvalue.$(OBJEXT) log.$(OBJEXT) vector.$(OBJEXT)
test_configfile_OBJECTS = $(am_test_configfile_OBJECTS)
test_configfile_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
@ -1104,7 +1104,7 @
test_buffer_LDADD = $(LIBUNWIND_LIBS)
test_base64_SOURCES = test_base64.c base64.c buffer.c
test_base64_LDADD = $(LIBUNWIND_LIBS)
-test_configfile_SOURCES = test_configfile.c buffer.c array.c data_string.c keyvalue.c log.c
+test_configfile_SOURCES = test_configfile.c buffer.c array.c data_string.c keyvalue.c log.c vector.c
test_configfile_LDADD = $(PCRE_LIB) $(LIBUNWIND_LIBS)
noinst_HEADERS = $(hdr)
EXTRA_DIST = \

Associated revisions

Revision 2af88b23 (diff)
Added by gstrauss 10 months ago

[autobuild] test_configfile might need vector.c (fixes #2752)

needed to build on Solaris using Oracle Solaris Studio (thx petrs)

x-ref:
"vector_realloc missing when linking test_configfile"
https://redmine.lighttpd.net/issues/2752

History

#1 Updated by petrs 10 months ago

If it cannot be read from above the fix is mainly to add vector.$(OBJEXT) to am_test_configfile_OBJECTS.

#2 Updated by gstrauss 10 months ago

  • Status changed from New to Patch Pending
  • Target version changed from 1.4.x to 1.4.42

Updating Makefile.am would be better, as Makefile.in is generated. Does the following work for you?

diff --git a/src/Makefile.am b/src/Makefile.am
index f87e9e5..0470c33 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -417,7 +417,7 @@ test_buffer_LDADD = $(LIBUNWIND_LIBS)
 test_base64_SOURCES = test_base64.c base64.c buffer.c
 test_base64_LDADD = $(LIBUNWIND_LIBS)

-test_configfile_SOURCES = test_configfile.c buffer.c array.c data_string.c keyvalue.c log.c
+test_configfile_SOURCES = test_configfile.c buffer.c array.c data_string.c keyvalue.c vector.c log.c
 test_configfile_LDADD = $(PCRE_LIB) $(LIBUNWIND_LIBS)

 noinst_HEADERS   = $(hdr)

#3 Updated by petrs 10 months ago

gstrauss wrote:

Updating Makefile.am would be better, as Makefile.in is generated. Does the following work for you?

It does. Thank you!

#4 Updated by gstrauss 10 months ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100

Also available in: Atom