NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

toolchain/40170: gcc -m32 issues with NEEDED



>Number:         40170
>Category:       toolchain
>Synopsis:       gcc -m32 issues with NEEDED
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 14 18:45:00 +0000 2008
>Originator:     Jared D. McNeill
>Release:        NetBSD 5.99.5
>Organization:
        
>Environment:
        
        
System: NetBSD black.invisible.ca 5.99.5 NetBSD 5.99.5 (GENERIC) #31: Sat Dec 
13 21:35:08 EST 2008 
jmcneill%black.invisible.ca@localhost:/export/home/jmcneill/branches/HEAD/src/sys/arch/amd64/compile/GENERIC
 amd64
Architecture: x86_64
Machine: amd64
>Description:
        Consider the following test case (where /usr/pkg contains x86_64
        binaries and /usr/pkg32 contains i386 binaries):

        Create an empty file eg:
                echo 'int main(void) { return 0; }' >m32.c

        Then run the following script:

        #!/bin/sh -x
        cc `/usr/pkg/bin/pkg-config --cflags gthread-2.0` \
            m32.c -o m32-64 `/usr/pkg/bin/pkg-config --libs gthread-2.0`
        cc -m32 `/usr/pkg32/bin/pkg-config --cflags gthread-2.0` \
            m32.c -o m32-64 `/usr/pkg32/bin/pkg-config --libs gthread-2.0`

        The first command links successfully, however the second fails:

+ '.' '/etc/shrc'
+ '/usr/pkg/bin/pkg-config' '--cflags' 'gthread-2.0'
+ '/usr/pkg/bin/pkg-config' '--libs' 'gthread-2.0'
+ cc '-pthread' '-I/usr/pkg/include/glib/glib-2.0' 
'-I/usr/pkg/lib/glib-2.0/include' 'm32.c' '-o' m32 '-Wl,-R/usr/pkg/lib' 
'-pthread' '-L/usr/pkg/lib' '-lgthread-2.0' '-lglib-2.0' '-lintl'
+ '/usr/pkg32/bin/pkg-config' '--cflags' 'gthread-2.0'
+ '/usr/pkg32/bin/pkg-config' '--libs' 'gthread-2.0'
+ cc '-m32' '-pthread' '-I/usr/pkg32/include/glib/glib-2.0' 
'-I/usr/pkg32/lib/glib-2.0/include' 'm32.c' '-o' m32 '-Wl,-R/usr/pkg32/lib' 
'-pthread' '-L/usr/pkg32/lib' '-lgthread-2.0' '-lpthread' '-lrt' '-lglib-2.0' 
'-lintl'
ld: warning: libpcre.so.0, needed by /usr/pkg32/lib/libglib-2.0.so, not found 
(try using -rpath or -rpath-link)
/usr/pkg32/lib/libglib-2.0.so: undefined reference to `pcre_compile2'
/usr/pkg32/lib/libglib-2.0.so: undefined reference to `pcre_dfa_exec'
/usr/pkg32/lib/libglib-2.0.so: undefined reference to `pcre_fullinfo'
/usr/pkg32/lib/libglib-2.0.so: undefined reference to 
`pcre_get_stringtable_entries'
/usr/pkg32/lib/libglib-2.0.so: undefined reference to `pcre_config'
/usr/pkg32/lib/libglib-2.0.so: undefined reference to `pcre_get_stringnumber'
/usr/pkg32/lib/libglib-2.0.so: undefined reference to `pcre_study'
/usr/pkg32/lib/libglib-2.0.so: undefined reference to `pcre_free'
/usr/pkg32/lib/libglib-2.0.so: undefined reference to `pcre_exec'

        However, /usr/pkg32/lib/libpcre.so.0 exists:

libpcre.so.0:     file format elf32-i386
libpcre.so.0
architecture: i386, flags 0x00000150:
HAS_SYMS, DYNAMIC, D_PAGED
start address 0x00000ec0

Program Header:
    LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
         filesz 0x00033bf0 memsz 0x00033bf0 flags r-x
    LOAD off    0x00033bf0 vaddr 0x00034bf0 paddr 0x00034bf0 align 2**12
         filesz 0x000001a0 memsz 0x000001c0 flags rw-
 DYNAMIC off    0x00033c04 vaddr 0x00034c04 paddr 0x00034c04 align 2**2
         filesz 0x000000b8 memsz 0x000000b8 flags rw-
    NOTE off    0x00033bc4 vaddr 0x00033bc4 paddr 0x00033bc4 align 2**2
         filesz 0x00000018 memsz 0x00000018 flags r--
    NOTE off    0x00033bdc vaddr 0x00033bdc paddr 0x00033bdc align 2**2
         filesz 0x00000014 memsz 0x00000014 flags r--

Dynamic Section:
  NEEDED      libc.so.12
  SONAME      libpcre.so.0
  RPATH       /usr/pkg32/lib
  INIT        0xd60
  FINI        0x25380
  HASH        0xd4
  STRTAB      0x7d8
  SYMTAB      0x318
  STRSZ       0x3e9
  SYMENT      0x10
  PLTGOT      0x34d1c
  PLTRELSZ    0xa0
  PLTREL      0x11
  JMPREL      0xcb4
  REL         0xbc4
  RELSZ       0xf0
  RELENT      0x8
  RELCOUNT    0x2

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .hash         00000244  000000d4  000000d4  000000d4  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  1 .dynsym       000004c0  00000318  00000318  00000318  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .dynstr       000003e9  000007d8  000007d8  000007d8  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .rel.dyn      000000f0  00000bc4  00000bc4  00000bc4  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .rel.plt      000000a0  00000cb4  00000cb4  00000cb4  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .init         0000000f  00000d60  00000d60  00000d60  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  6 .plt          00000150  00000d70  00000d70  00000d70  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  7 .text         000244b4  00000ec0  00000ec0  00000ec0  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  8 .fini         0000000a  00025380  00025380  00025380  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  9 .rodata       0000e820  000253a0  000253a0  000253a0  2**5
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 10 .eh_frame     00000004  00033bc0  00033bc0  00033bc0  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 11 .note.netbsd.ident 00000018  00033bc4  00033bc4  00033bc4  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 12 .note.netbsd.pax 00000014  00033bdc  00033bdc  00033bdc  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 13 .ctors        00000008  00034bf0  00034bf0  00033bf0  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 14 .dtors        00000008  00034bf8  00034bf8  00033bf8  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 15 .jcr          00000004  00034c00  00034c00  00033c00  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 16 .dynamic      000000b8  00034c04  00034c04  00033c04  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 17 .got          00000060  00034cbc  00034cbc  00033cbc  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 18 .got.plt      0000005c  00034d1c  00034d1c  00033d1c  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 19 .data         00000018  00034d78  00034d78  00033d78  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 20 .bss          00000020  00034d90  00034d90  00033d90  2**2
                  ALLOC
 21 .comment      000005a8  00000000  00000000  00033d90  2**0
                  CONTENTS, READONLY
SYMBOL TABLE:
000000d4 l    d  .hash  00000000 .hash
00000318 l    d  .dynsym        00000000 .dynsym
000007d8 l    d  .dynstr        00000000 .dynstr
00000bc4 l    d  .rel.dyn       00000000 .rel.dyn
00000cb4 l    d  .rel.plt       00000000 .rel.plt
00000d60 l    d  .init  00000000 .init
00000d70 l    d  .plt   00000000 .plt
00000ec0 l    d  .text  00000000 .text
00025380 l    d  .fini  00000000 .fini
000253a0 l    d  .rodata        00000000 .rodata
00033bc0 l    d  .eh_frame      00000000 .eh_frame
00033bc4 l    d  .note.netbsd.ident     00000000 .note.netbsd.ident
00033bdc l    d  .note.netbsd.pax       00000000 .note.netbsd.pax
00034bf0 l    d  .ctors 00000000 .ctors
00034bf8 l    d  .dtors 00000000 .dtors
00034c00 l    d  .jcr   00000000 .jcr
00034c04 l    d  .dynamic       00000000 .dynamic
00034cbc l    d  .got   00000000 .got
00034d1c l    d  .got.plt       00000000 .got.plt
00034d78 l    d  .data  00000000 .data
00034d90 l    d  .bss   00000000 .bss
00000000 l    d  .comment       00000000 .comment
00000000 l    d  *ABS*  00000000 .shstrtab
00000000 l    d  *ABS*  00000000 .symtab
00000000 l    d  *ABS*  00000000 .strtab
00000000 l    df *ABS*  00000000 crti.c
00000000 l    df *ABS*  00000000 crtbeginS.c
00034bf0 l     O .ctors 00000000 __CTOR_LIST__
00034bf8 l     O .dtors 00000000 __DTOR_LIST__
00033bc0 l     O .eh_frame      00000000 __EH_FRAME_BEGIN__
00034c00 l     O .jcr   00000000 __JCR_LIST__
00034d90 l     O .bss   00000001 completed.3420
00034d7c l     O .data  00000000 p.3418
00000ec0 l     F .text  00000000 __do_global_dtors_aux
00034d94 l     O .bss   00000018 object.3478
00000f40 l     F .text  00000000 frame_dummy
00000000 l    df *ABS*  00000000 crtendS.c
00034bf4 l     O .ctors 00000000 __CTOR_END__
00034bfc l     O .dtors 00000000 __DTOR_END__
00033bc0 l     O .eh_frame      00000000 __FRAME_END__
00034c00 l     O .jcr   00000000 __JCR_END__
00025340 l     F .text  00000000 __do_global_ctors_aux
00000000 l    df *ABS*  00000000 crtn.c
00000000 l    df *ABS*  00000000 pcre_compile.c
000253a0 l     O .rodata        00000096 escapes
00025440 l     O .rodata        00000025 verbnames
00025480 l     O .rodata        00000038 verbs
000254b8 l     O .rodata        00000004 verbcount
000254c0 l     O .rodata        00000054 posix_names
00025514 l     O .rodata        0000000f posix_name_lengths
00025540 l     O .rodata        000000a8 posix_class_maps
00025600 l     O .rodata        00000929 error_texts
00025f40 l     O .rodata        00000100 digitab
00000fa0 l     F .text  0000003c find_error_text
00000fdc l     F .text  000006c3 check_escape
0000169f l     F .text  000001c1 get_ucp
00001860 l     F .text  00000102 is_counted_repeat
00001962 l     F .text  00000145 read_repeat_counts
00001aa7 l     F .text  00000357 find_parens
00001dfe l     F .text  00000138 first_significant_code
00001f36 l     F .text  000004e1 find_fixedlength
00002417 l     F .text  000001a5 find_bracket
000025bc l     F .text  00000163 find_recurse
0000271f l     F .text  000004ac could_be_empty_branch
00002bcb l     F .text  00000056 could_be_empty
00002c21 l     F .text  0000008a check_posix_syntax
00002cab l     F .text  00000096 check_posix_name
00002d41 l     F .text  0000010a adjust_recurse
00002e4b l     F .text  00000062 auto_callout
00002ead l     F .text  0000005f complete_callout
00002f0c l     F .text  0000010f get_othercase_range
0000301b l     F .text  000010ce check_auto_possessive
000040e9 l     F .text  000061b6 compile_branch
0000a29f l     F .text  00000450 compile_regex
0000a6ef l     F .text  000001ee is_anchored
0000a8dd l     F .text  000001bc is_startline
0000aa99 l     F .text  0000027e find_firstassertedchar
00000000 l    df *ABS*  00000000 pcre_config.c
00000000 l    df *ABS*  00000000 pcre_dfa_exec.c
000260a0 l     O .rodata        00000070 coptable
00026110 l     O .rodata        0000000e toptable1
0002611e l     O .rodata        0000000e toptable2
0000b9dc l     F .text  00007d54 internal_dfa_exec
00000000 l    df *ABS*  00000000 pcre_exec.c
0002612c l     O .rodata        00000006 rep_min
00026132 l     O .rodata        00000006 rep_max
00014540 l     F .text  0000029c match_ref
000147dc l     F .text  0000ca98 match
00000000 l    df *ABS*  00000000 pcre_fullinfo.c
00000000 l    df *ABS*  00000000 pcre_get.c
00022bc3 l     F .text  000000f3 get_first_set
00000000 l    df *ABS*  00000000 pcre_globals.c
00000000 l    df *ABS*  00000000 pcre_info.c
00000000 l    df *ABS*  00000000 pcre_maketables.c
00000000 l    df *ABS*  00000000 pcre_newline.c
00000000 l    df *ABS*  00000000 pcre_ord2utf8.c
00000000 l    df *ABS*  00000000 pcre_refcount.c
00000000 l    df *ABS*  00000000 pcre_study.c
00023c90 l     F .text  000000ad set_bit
00023d3d l     F .text  00000ac7 set_start_bits
00000000 l    df *ABS*  00000000 pcre_tables.c
00000000 l    df *ABS*  00000000 pcre_try_flipped.c
00024a50 l     F .text  00000063 byteflip
00000000 l    df *ABS*  00000000 pcre_ucd.c
00000000 l    df *ABS*  00000000 pcre_valid_utf8.c
00000000 l    df *ABS*  00000000 pcre_version.c
00000000 l    df *ABS*  00000000 pcre_xclass.c
00000000 l    df *ABS*  00000000 pcre_chartables.c
0000b90b l     F .text  00000000 .hidden __i686.get_pc_thunk.cx
00034d78 l     O .data  00000000 .hidden __dso_handle
00000f99 l     F .text  00000000 .hidden __i686.get_pc_thunk.bx
00034d1c l     O *ABS*  00000000 .hidden _GLOBAL_OFFSET_TABLE_
00029960 g     O .rodata        00009e00 _pcre_ucd_stage2
00022cb6 g     F .text  0000008f pcre_copy_substring
0000ad5e g     F .text  00000bad pcre_compile2
00013730 g     F .text  00000e0d pcre_dfa_exec
0002377c g     F .text  000001f7 _pcre_is_newline
00000000       F *UND*  00000000 memmove
00034c04 g     O *ABS*  00000000 _DYNAMIC
00026248 g     O .rodata        00000004 _pcre_utf8_table1_size
00026340 g     O .rodata        000002e4 _pcre_utt_names
00022564 g     F .text  00000319 pcre_fullinfo
00000000  w    F *UND*  00000000 __cxa_finalize
00033780 g     O .rodata        00000440 _pcre_default_tables
00023c14 g     F .text  0000007c pcre_refcount
00000000       F *UND*  00000000 malloc
000262c0 g     O .rodata        00000078 _pcre_ucp_gentype
00027760 g     O .rodata        00002200 _pcre_ucd_stage1
00023973 g     F .text  00000211 _pcre_was_newline
00000d60 g       .init  00000000 _init
00022dbb g     F .text  0000012d pcre_get_substring_list
00026230 g     O .rodata        00000018 _pcre_utf8_table1
00022f10 g     F .text  000000b5 pcre_get_substring
00026640 g     O .rodata        000002b8 _pcre_utt
00024e98 g     F .text  00000033 pcre_version
00000000       O *UND*  00000000 _toupper_tab_
00023034 g     F .text  00000028 pcre_free_substring
00000000  w      *UND*  00000000 __deregister_frame_info
00034d80 g     O .data  00000004 pcre_malloc
00026264 g     O .rodata        00000018 _pcre_utf8_table3
00000000       F *UND*  00000000 strncmp
00024ecc g     F .text  0000046e _pcre_xclass
000229e0 g     F .text  000001e3 pcre_get_stringtable_entries
00026280 g     O .rodata        00000040 _pcre_utf8_table4
0002624c g     O .rodata        00000018 _pcre_utf8_table2
0000ad17 g     F .text  00000047 pcre_compile
00034d90 g       *ABS*  00000000 __bss_start
00000000       F *UND*  00000000 memset
00024ab3 g     F .text  000001f7 _pcre_try_flipped
0000b910 g     F .text  000000cc pcre_config
00000000       F *UND*  00000000 strcmp
00025380 g       .fini  00000000 _fini
00023b84 g     F .text  0000008f _pcre_ord2utf8
000268f8 g     O .rodata        00000004 _pcre_utt_size
00022d45 g     F .text  00000076 pcre_copy_named_substring
00022fc5 g     F .text  0000006f pcre_get_named_substring
00034d88 g     O .data  00000004 pcre_stack_malloc
000261c0 g     O .rodata        00000070 _pcre_OP_lengths
00034d90 g       *ABS*  00000000 _edata
00034db0 g       *ABS*  00000000 _end
00022880 g     F .text  00000160 pcre_get_stringnumber
00024804 g     F .text  0000024a pcre_study
00034d8c g     O .data  00000004 pcre_stack_free
00034d84 g     O .data  00000004 pcre_free
00000000       O *UND*  00000000 _tolower_tab_
00034dac g     O .bss   00000004 pcre_callout
00024cac g     F .text  000001ec _pcre_valid_utf8
00000000       O *UND*  00000000 _ctype_
00023148 g     F .text  00000632 pcre_maketables
00000000       F *UND*  00000000 strchr
00000000  w      *UND*  00000000 _Jv_RegisterClasses
00022ee8 g     F .text  00000028 pcre_free_substring_list
00021274 g     F .text  000012ee pcre_exec
00000000  w      *UND*  00000000 __register_frame_info
00026900 g     O .rodata        00000e48 _pcre_ucd_records
00000000       F *UND*  00000000 free
0002305c g     F .text  000000ea pcre_info


>How-To-Repeat:
        
>Fix:
        

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index