[Bug 741] Issue with linking autoconf generated tests when networking is enabled
bugzilla-daemon at rtems.org
bugzilla-daemon at rtems.org
Tue Aug 5 16:32:04 UTC 2008
http://www.rtems.org/bugzilla/show_bug.cgi?id=741
Joel Sherrill <joel.sherrill at oarcorp.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |WAITING
The problem is discussed in a thread starting here:
http://www.rtems.org/ml/rtems-users/2005/january/msg00102.html
Example: test for gethostname looks:
----->start<-------------
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostname(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char gethostname();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_gethostname) || defined (__stub___gethostname)
choke me
#else
gethostname();
#endif
; return 0; }
------>end<--------------
and it is compiled with (those parameters are already hacked by me into
the configure):
configure:7258: i386-rtems-c++ -o conftest -O2
-B/mnt/karel/rtems-x86/i386-rtems/pc386//lib -specs bsp_specs -qrtems
-B/mnt/karel/rtems-x86/i386-rtems/pc386/lib/ -Wl,-Ttext,0x00100000
/mnt/karel/rtems-x86/i386-rtems/pc386/lib/no-dpmem.rel
/mnt/karel/rtems-x86/i386-rtems/pc386/lib/no-msg.rel
/mnt/karel/rtems-x86/i386-rtems/pc386/lib/no-mp.rel
/mnt/karel/rtems-x86/i386-rtems/pc386/lib/no-part.rel
/mnt/karel/rtems-x86/i386-rtems/pc386/lib/no-signal.rel
/mnt/karel/rtems-x86/i386-rtems/pc386/lib/no-timer.rel
/mnt/karel/rtems-x86/i386-rtems/pc386/lib/no-rtmon.rel conftest.C -lm 1>&5
which results in undefined references:
/mnt/karel/rtems-x86/i386-rtems/pc386//lib/librtemscpu.a(rtems_glue.o): In
function `rtems_bsdnet_initialize_network':
/mnt/karel/downloads/RTEMS/build/tools/obj-rtems/i386-rtems/c/pc386/exec/libnetworking/../../../../../../rtems/cpukit/libnetworking/r
tems/rtems_glue.c:944: undefined reference to `rtems_bsdnet_config'
/mnt/karel/downloads/RTEMS/build/tools/obj-rtems/i386-rtems/c/pc386/exec/libnetworking/../../../../../../rtems/cpukit/libnetworking/r
tems/rtems_glue.c:953: undefined reference to `rtems_bsdnet_config'
/mnt/karel/rtems-x86/i386-rtems/pc386//lib/librtemscpu.a(rtems_glue.o): In
function `rtems_bsdnet_initialize':
/mnt/karel/downloads/RTEMS/build/tools/obj-rtems/i386-rtems/c/pc386/exec/libnetworking/../../../../../../rtems/cpukit/libnetworking/r
tems/rtems_glue.c:226: undefined reference to `rtems_bsdnet_config'
/mnt/karel/downloads/RTEMS/build/tools/obj-rtems/i386-rtems/c/pc386/exec/libnetworking/../../../../../../rtems/cpukit/libnetworking/r
tems/rtems_glue.c:234: undefined reference to `rtems_bsdnet_config'
/mnt/karel/downloads/RTEMS/build/tools/obj-rtems/i386-rtems/c/pc386/exec/libnetworking/../../../../../../rtems/cpukit/libnetworking/r
tems/rtems_glue.c:236: undefined reference to `rtems_bsdnet_config'
/mnt/karel/rtems-x86/i386-rtems/pc386//lib/librtemscpu.a(rtems_glue.o):/mnt/karel/downloads/RTEMS/build/tools/obj-rtems/i386-rtems/c/
pc386/exec/libnetworking/../../../../../../rtems/cpukit/libnetworking/rtems/rtems_glue.c:813:
more undefined references to `rtems_bsdnet_config' follow
Release:
4.6.2
Environment:
pc386 BSP + 4.6.2 release recommended tools and their patches
--- Comment #1 from kgardas at objectsecurity.com 2005-01-13 06:11:27 ---
Fix:
Unknown
--- Comment #2 from Joel Sherrill <joel.sherrill at oarcorp.com> 2005-01-20 11:16:58 ---
State-Changed-From-To: open->feedback
State-Changed-Why: Do you have a local patch to dummy.c that could be merged?
--- Comment #3 from kgardas at objectsecurity.com 2005-01-24 20:38:00 ---
From: Karel Gardas <kgardas at objectsecurity.com>
To: bugs at rtems.com
Cc: norume at aps.anl.gov, <joel at oarcorp.com>, <jmj at oarcorp.com>,
<jennifer at oarcorp.com>, <ralf_corsepius at rtems.org>,
<chrisj at rtems.com>, <mayes at oarcorp.com>
Subject: Re: RTEMS Re: networking/741
Date: Mon, 24 Jan 2005 20:38:00 +0100 (CET)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime at docserver.cac.washington.edu for more info.
--655872-1592121218-1106595480=:1467
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Thu, 20 Jan 2005 RTEMS-gnats at rtems.com wrote:
> Synopsis: Issue with linking autoconf generated tests when networking is enabled
>
> State-Changed-From-To: open->feedback
> State-Changed-By: joel
> State-Changed-When: Thu, 20 Jan 2005 11:16:58 -0600
> State-Changed-Why:
> Do you have a local patch to dummy.c that could be merged?
Only what you have recommended on rtems-users@ mailing list. It is
attached. Anyway, I can confirm that when I manually copy dummy.o to rtems
bsp installation as dummy.rel and use autoconf recommended way as
described in cpukit/libmisc/dummy/README, then I'm able to get
network related autoconf test programms compiling/linking well.
The only issue is that I have not managed RTEMS makefile machinery to do
this manual work for me yet.
Cheers,
Karel
--
Karel Gardas kgardas at objectsecurity.com
ObjectSecurity Ltd. http://www.objectsecurity.com
--655872-1592121218-1106595480=:1467
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="dummy.c.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.43.0501242038000.1467 at thinkpad.gardas.net>
Content-Description:
Content-Disposition: attachment; filename="dummy.c.patch"
SW5kZXg6IGR1bW15LmMNCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NClJDUyBm
aWxlOiAvdXNyMS9DVlMvcnRlbXMvY3B1a2l0L2xpYm1pc2MvZHVtbXkvZHVt
bXkuYyx2DQpyZXRyaWV2aW5nIHJldmlzaW9uIDEuNS40LjINCmRpZmYgLXUg
LXIxLjUu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yogRGVmYXVsdCBtYnVmIGNhcGFjaXR5ICovDQorICAgIDAsICAgICAgICAg
ICAgICAgICAgICAgIC8qIERlZmF1bHQgbWJ1ZiBjbHVzdGVyIGNhcGFjaXR5
ICovDQorICAgICJ0ZXN0U3lzdGVtIiwgICAgICAgICAgIC8qIEhvc3QgbmFt
ZSAqLw0KKyAgICAibm93aGVyZS5jb20iLCAgICAgICAgICAvKiBEb21haW4g
bmFtZSAqLw0KKyAgICAiMTI3LjAuMC4xIiwgICAgICAgICAgICAvKiBHYXRl
d2F5ICovDQorICAgICIxMjcuMC4wLjEiLCAgICAgICAgICAgIC8qIExvZyBo
b3N0ICovDQorICAgIHsiMTI3LjAuMC4xIiB9LCAgICAgICAgIC8qIE5hbWUg
c2VydmVyKHMpICovDQorICAgIHsiMTI3LjAuMC4xIiB9LCAgICAgICAgIC8q
IE5UUCBzZXJ2ZXIocykgKi8NCit9Ow0KKw0KKyNlbmRpZg0KKw0KIGludCBt
YWluKCBpbnQsIGNoYXIgKiosIGNoYXIgKiopOw0KIA0KIC8qIGNvbmZpZ3Vy
YXRpb24gaW5mb3JtYXRpb24gKi8NCg==
--655872-1592121218-1106595480=:1467--
--- Comment #4 from Joel Sherrill <joel.sherrill at oarcorp.com> 2008-08-05 11:32:04 ---
Created an attachment (id=554)
--> (http://www.rtems.org/bugzilla/attachment.cgi?id=554)
Add Loopback Network Configuration
--
Configure bugmail: http://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the bugs
mailing list