delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/10/06/11:18:56

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_LR
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Date: Thu, 6 Oct 2011 10:18:11 -0500
Message-ID: <CALEg2upCqLY-GgK19igDvkFezWV+dcCPbS4mCx+JGKOmu1qXAQ@mail.gmail.com>
Subject: New (to me) undefined symbol issue when linking
From: Nathan Thern <nthern AT gmail DOT com>
To: cygwin <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

I'm building a library called libschroedinger1.0-1.0.10
The make step fails at this point:

--- BEGIN ---
libtool: link: gcc -Wall
-I/usr/src/libschroedinger1.0-1.0.10-1/src/schroedinger-1.0.10
-I/usr/include/orc-0.4 -DSCHRO_ENABLE_UNSTABLE_API -g -O3 -pipe -o
.libs/wavelet_2d.exe wavelet_2d.o  ./.libs/libschrotest.a
/usr/src/libschroedinger1.0-1.0.10-1/build/schroedinger/.libs/libschroedinger-1.0.dll.a
../schroedinger/.libs/libschroedinger-1.0.dll.a
/usr/lib/gcc/i686-pc-cygwin/4.5.3/libstdc++.dll.a -lpthread
/usr/lib/liborc-test-0.4.dll.a /usr/lib/liborc-0.4.dll.a -lrt
-L/usr/lib/gcc/i686-pc-cygwin/4.5.3
wavelet_2d.o: In function `orc_deinterleave2_s16':
/usr/src/libschroedinger1.0-1.0.10-1/build/testsuite/../schroedinger/schroorc.h:1058:
undefined reference to `__orc_code_orc_deinterleave2_s16'
wavelet_2d.o: In function `orc_interleave2_s16':
/usr/src/libschroedinger1.0-1.0.10-1/build/testsuite/../schroedinger/schroorc.h:1020:
undefined reference to `__orc_code_orc_interleave2_s16'
collect2: ld returned 1 exit status
--- END ---

Delving into the object files with nm, I find:

--- BEGIN ---
$ find /usr/src/libschroedinger1.0-1.0.10-1/build/ -type f | xargs nm
-A --defined-only 2>/dev/null | grep orc_code_orc_deinterleave2_s16
/usr/src/libschroedinger1.0-1.0.10-1/build/schroedinger/.libs/cygschroedinger-1.0-0.dll:63b2b4dc
B __orc_code_orc_deinterleave2_s16
/usr/src/libschroedinger1.0-1.0.10-1/build/schroedinger/.libs/libschroedinger_1.0_la-tmp-orc.o:00000004
C __orc_code_orc_deinterleave2_s16
--- END ---

So it's apparent that the symbols are declared, but not initialized,
in tmp-orc.c, the source for libschroedinger_1.0_la-tmp-orc.o
Delving into the source files I find that:
schroorc.h declares the symbols as extern, but does not define them.
tmp-orc.c sets the symbols inside of an init function.

It turns out that both schroorc.h & tmp-orc.c are created from
schroorc.orc using orcc.exe from the ORC package. I built ORC
immediately before attempting libschroedinger and I know nothing about
ORC other than that schroorc.orc sure looks a lot like assembly.

So, I'm a little stumped about how I can get this lib to build.
Is there a linker or compiler option I can use to force uninitialized
symbols to be initialized to NULL?
Any other suggestions for a way forward?

NT

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019