mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: musl-gcc vs. BusyBox 1.18.5: multiple definitions of '_start'
Date: Thu, 14 Jul 2011 16:28:39 -0400	[thread overview]
Message-ID: <20110714202839.GN16618@brightrain.aerifal.cx> (raw)
In-Reply-To: <20110714132437.507176ef@newbook>

On Thu, Jul 14, 2011 at 01:24:37PM -0700, Isaac Dunham wrote:
> I'm trying to set up a musl-based busybox system, using a version of
> musl (d3fd192523db544e6005051f224a2d7bafabedd9) that I pulled from git
> just an hour or so ago (prefix=/opt/musl).
> My host is Ubuntu 10.04 "Lucid Lynx" with gcc 4.4.3.
> When I build busybox 1.18.5 with the default cc (gcc using eglibc), it
> compiles appropriately.  But when I use "CC=musl-gcc", compilation fails
> at the link step (I did a little patching to get that far, BTW):  
> AR util-linux/volume_id/lib.a 
> LINK    busybox_unstripped
> Trying libraries: crypt m
> Failed: -Wl,--start-group -lcrypt -lm -Wl,--end-group
> Output of:
> musl-gcc -Wall -Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes
> -Wunused -Wunused-parameter -Wunused-function -Wunused-value
> -Wmissing-prototypes -Wmissing-declarations
> -Wdeclaration-after-statement -Wold-style-definition
> -fno-builtin-strlen -finline-limit=0 -fomit-frame-pointer
> -ffunction-sections -fdata-sections -fno-guess-branch-probability
> -funsigned-char -static-libgcc -falign-functions=1 -falign-jumps=1
> -falign-labels=1 -falign-loops=1 -Os -march=i386
> -mpreferred-stack-boundary=2 -static -o busybox_unstripped
> -Wl,--sort-common -Wl,--sort-section,alignment -Wl,--gc-sections
> -Wl,--start-group applets/built-in.o archival/lib.a
> archival/libarchive/lib.a console-tools/lib.a coreutils/lib.a
> coreutils/libcoreutils/lib.a debianutils/lib.a e2fsprogs/lib.a
> editors/lib.a findutils/lib.a init/lib.a libbb/lib.a libpwdgrp/lib.a
> loginutils/lib.a mailutils/lib.a miscutils/lib.a modutils/lib.a
> networking/lib.a networking/libiproute/lib.a networking/udhcp/lib.a
> printutils/lib.a procps/lib.a runit/lib.a selinux/lib.a shell/lib.a
> sysklogd/lib.a util-linux/lib.a util-linux/volume_id/lib.a
> archival/built-in.o archival/libarchive/built-in.o
> console-tools/built-in.o coreutils/built-in.o
> coreutils/libcoreutils/built-in.o debianutils/built-in.o
> e2fsprogs/built-in.o editors/built-in.o findutils/built-in.o
> init/built-in.o libbb/built-in.o libpwdgrp/built-in.o
> loginutils/built-in.o mailutils/built-in.o miscutils/built-in.o
> modutils/built-in.o networking/built-in.o
> networking/libiproute/built-in.o networking/udhcp/built-in.o
> printutils/built-in.o procps/built-in.o runit/built-in.o
> selinux/built-in.o shell/built-in.o sysklogd/built-in.o
> util-linux/built-in.o util-linux/volume_id/built-in.o -Wl,--end-group
> -Wl,--start-group -lcrypt -lm -Wl,--end-group ==========
> applets/built-in.o: In function `_start': (.text+0x0): multiple
> definition of `_start' /opt/musl/lib/crt1.o:(.text+0x0): first defined
> here collect2: ld returned 1 exit status make: *** [busybox_unstripped]
> Error 1
> =======END of error
> grep + strings tell me that "_start" is found in crt1.o, and in the
> "start.o" section of libc.a (and libc.so). 

It looks like the built-in.o files have been compiled/linked
incorrectly, probably due to the linker wrapper in the musl-gcc script
not being able to detect that busybox is trying to link multiple .o
files to make a new .o file rather than an executable file.
Unfortunately the kbuild system busybox uses is really obfuscated and
it's hard for me to tell quite what's going on or how to work around
it...

Ideas anyone?

Rich


  reply	other threads:[~2011-07-14 20:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-14 20:24 Isaac Dunham
2011-07-14 20:28 ` Rich Felker [this message]
2011-07-15 10:01 ` Christian Neukirchen
2011-07-16  4:14 Isaac Dunham

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=20110714202839.GN16618@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).