Project

General

Profile

Actions

Bug #2752

closed

vector_realloc missing when linking test_configfile

Added by petrs over 7 years ago. Updated over 7 years ago.

Status:
Fixed
Priority:
Normal
Category:
build_autotools
Target version:
ASK QUESTIONS IN Forums:

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 = \

Actions #1

Updated by petrs over 7 years ago

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

Actions #2

Updated by gstrauss over 7 years 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)
Actions #3

Updated by petrs over 7 years ago

gstrauss wrote:

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

It does. Thank you!

Actions #4

Updated by gstrauss over 7 years ago

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

Also available in: Atom