#741 closed defect (fixed)

Issue with linking autoconf generated tests when networking is enabled

Reported by: kgardas Owned by: Eric Norum
Priority: highest Milestone: 4.9
Component: network/legacy Version: 4.6
Severity: critical Keywords:
Cc: bugs@…, joel.sherrill@…, kgardas@… Blocked By:
Blocking:

Description

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:


#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; }


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/pc386lib -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/pc386lib/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/pc386lib/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

Attachments (1)

pr741.diff (1.8 KB) - added by Joel Sherrill on Aug 5, 2008 at 3:32:04 PM.
Add Loopback Network Configuration

Download all attachments as: .zip

Change History (3)

comment:1 Changed on Jan 20, 2005 at 4:16:58 PM by Joel Sherrill

Status: assignedwaiting

Changed on Aug 5, 2008 at 3:32:04 PM by Joel Sherrill

Attachment: pr741.diff added

Add Loopback Network Configuration

comment:2 Changed on Aug 5, 2008 at 3:33:43 PM by Joel Sherrill

Milestone: 4.9
rep_platform: All
Resolution: fixed
Status: assignedclosed

Patch committed to all active branches.

Note: See TracTickets for help on using tickets.