All of lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Naour <romain.naour@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] glibc link fails on x86_64 with fPIC error
Date: Tue, 6 Nov 2018 22:02:46 +0100	[thread overview]
Message-ID: <ad5a8efa-05ea-08ef-a847-213bfeb345d0@gmail.com> (raw)
In-Reply-To: <1541536520382-0.post@n4.nabble.com>

Hi,

Le 06/11/2018 ? 21:35, mws a ?crit?:
> Thanks Matt and also Roman. In meantime I discovered something interesting:
> with libc=musl the build succeeds, but with libc=uClibc-ng it fails in a way
> similar to glibc, which I think exonerates glibc.  Here is the ucLibC
> failure with the similar linking error:
> 
> $ tail -20 tools.log
>  AR cr libc/libc_so.a
>  STRIP -x -R .note -R .comment libc/libc_so.a
>  CC libpthread/nptl/pthread_atfork.oS
>  AR cr lib/libpthread_nonshared.a
>  STRIP -x -R .note -R .comment lib/libpthread_nonshared.a
>  LD libuClibc-1.0.30.so
> ./lib/ld64-uClibc.so.1: warning: multiple common of
> `_dl_internal_error_number'
> libc/libc_so.a(libdl.oS): warning: previous common is here
> ./lib/ld64-uClibc.so.1: warning: multiple common of `_dl_error_number'
> libc/libc_so.a(libdl.oS): warning: previous common is here
> ./lib/ld64-uClibc.so.1: warning: multiple common of `_dl_free_function'
> libc/libc_so.a(libdl.oS): warning: previous common is here
> ./lib/ld64-uClibc.so.1: warning: multiple common of `_dl_malloc_function'
> libc/libc_so.a(libdl.oS): warning: previous common is here
> /home/build/src/docker/buildroot/host/lib/gcc/x86_64-buildroot-linux-uclibc/7.3.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld:

Can you try outside of docker ?
Also, we don't recommend to run the build as root.

Best regards,
Romain

> libc/libc_so.a(libc-cancellation.oS): relocation R_X86_64_PC32 against
> symbol `__pthread_unwind' can not be used when making a shared object;
> recompile with -fPIC
> /home/build/src/docker/buildroot/host/lib/gcc/x86_64-buildroot-linux-uclibc/7.3.0/../../../../x86_64-buildroot-linux-uclibc/bin/ld:
> final link failed: Bad value
> collect2: error: ld returned 1 exit status
> make[2]: *** [lib/libc.so] Error 1
> make[1]: ***
> [/home/build/src/docker/buildroot/build/uclibc-1.0.30/.stamp_built] Error 2
> make: *** [_all] Error 2
> 
> So my hypothesis is that something about my build system environment is
> causing a misconfiguration of the toolchain with respect to gcc's defaults. 
> I am thinking maybe the pic/PIC default or the mcmodel default is somehow
> different from what glibc or uClibc-ng Makefiles expect it to be, and they
> are not setting those options to be explicitly the way they should be in
> their respective Makefiles.
> 
> So I need to figure out what part of the toolchain build is looking at the
> system itself to determine defaults in this area, or alternatively find the
> specific gcc setting and change its default manually in buildroot's config.
> 
> 
> 
> 
> --
> Sent from: http://buildroot-busybox.2317881.n4.nabble.com/
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 

      reply	other threads:[~2018-11-06 21:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 16:09 [Buildroot] glibc link fails on x86_64 with fPIC error mws
2018-11-06 16:19 ` Matthew Weber
2018-11-06 16:49   ` mws
2018-11-06 19:33     ` Romain Naour
     [not found]   ` <A800D6A5-EA42-4289-9ADB-B7ABAF44BB3F@gmail.com>
2018-11-06 20:29     ` Matthew Weber
2018-11-06 20:35       ` mws
2018-11-06 21:02         ` Romain Naour [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ad5a8efa-05ea-08ef-a847-213bfeb345d0@gmail.com \
    --to=romain.naour@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.