arm-linux-gnueabi-ld doens't search /usr/arm-linux-gnueabi/lib

Bug #666276 reported by Loïc Minier
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
binutils (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: binutils

Hi

the SEARCH_DIR list is probably wrong:
ld --verbose | grep SEARCH
SEARCH_DIR("/usr/x86_64-linux-gnu/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");

arm-linux-gnueabi-ld --verbose | grep SEARCH
SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");

this is withbinutils-arm-linux-gnueabi 2.20.51.20100908-0ubuntu2cross1.50 and binutils 2.20.51.20101014-0ubuntu1

I think we want the cross-toolchain to also look at /usr/$target_triplet/lib.

I'm not actually sure it's correct for our toolchain to look at lib64 rather than lib.

Thanks,

Tags: armel
Revision history for this message
Loïc Minier (lool) wrote :

Actually, I have a test case for this issue:
arm-linux-gnueabi-gcc -fPIC -c libfoo.c
arm-linux-gnueabi-ld -z defs -shared -o libfoo.so libfoo.o -lpthread
arm-linux-gnueabi-ld: skipping incompatible //usr/lib/libpthread.so when searching for -lpthread
//usr/lib/libpthread.a: could not read symbols: File format not recognized
(fails)

this is with libfoo.c:
#include "libfoo.h"

#include <pthread.h>

int libfoo_run(void) {
    pthread_mutex_t m;

    return pthread_mutex_init(&m, NULL);
}

and libfoo.h:
int libfoo_run(void);

Matthias Klose (doko)
tags: added: armel
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

Works for me under Natty:

15:29 hrw@home:a$ cat libfoo.h
int libfoo_run(void);
15:29 hrw@home:a$ cat libfoo.c
#include "libfoo.h"

#include <pthread.h>

int libfoo_run(void) {
    pthread_mutex_t m;

    return pthread_mutex_init(&m, NULL);
} /* int libfoo_run(void) */
15:29 hrw@home:a$ arm-linux-gnueabi-gcc -fPIC -c libfoo.c
15:29 hrw@home:a$ arm-linux-gnueabi-ld -z defs -shared -o libfoo.so libfoo.o -lpthread
15:29 hrw@home:a$ file *
libfoo.c: ASCII C program text
libfoo.h: ASCII text
libfoo.o: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
libfoo.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped

15:29 hrw@home:a$ LC_ALL=C apt-cache policy binutils-arm-linux-gnueabi
binutils-arm-linux-gnueabi:
  Installed: 2.21-1ubuntu4cross1.55
  Candidate: 2.21-1ubuntu4cross1.55
  Version table:
 *** 2.21-1ubuntu4cross1.55 0
        999 http://de.archive.ubuntu.com/ubuntu/ natty/universe amd64 Packages
        100 /var/lib/dpkg/status
     2.20.51.20100908-0ubuntu2cross1.50 0
        999 http://de.archive.ubuntu.com/ubuntu/ maverick/universe amd64 Packages

And under Maverick:

(devel/maverick/amd64)root@home:/tmp/a# arm-linux-gnueabi-gcc -fPIC -c libfoo.c
(devel/maverick/amd64)root@home:/tmp/a# arm-linux-gnueabi-ld -z defs -shared -o libfoo.so libfoo.o -lpthread
(devel/maverick/amd64)root@home:/tmp/a# file *
libfoo.c: ASCII C program text
libfoo.h: ASCII text
libfoo.o: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
libfoo.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped
(devel/maverick/amd64)root@home:/tmp/a# apt-cache policy binutils-arm-linux-gnueabi
binutils-arm-linux-gnueabi:
  Installed: 2.20.51.20100908-0ubuntu2cross1.52
  Candidate: 2.20.51.20100908-0ubuntu2cross1.52
  Version table:
 *** 2.20.51.20100908-0ubuntu2cross1.52 0
        500 http://archive.ubuntu.com/ubuntu/ maverick-proposed/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu/ maverick-updates/universe amd64 Packages
        100 /var/lib/dpkg/status
     2.20.51.20100908-0ubuntu2cross1.50 0
        500 http://pl.archive.ubuntu.com/ubuntu/ maverick/universe amd64 Packages

Changed in binutils (Ubuntu):
status: New → Fix Released
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

15:33 hrw@home:~$ arm-linux-gnueabi-ld --verbose | grep SEARCH
SEARCH_DIR("/usr/arm-linux-gnueabi/lib");
15:33 hrw@home:~$ sudo chroot devel/chroots/maverick-amd64/
(devel/maverick/amd64)root@home:/# arm-linux-gnueabi-ld --verbose | grep SEARCH
SEARCH_DIR("/usr/arm-linux-gnueabi/lib");

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.