From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/167 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: musl-gcc vs. BusyBox 1.18.5: multiple definitions of '_start' Date: Thu, 14 Jul 2011 16:28:39 -0400 Message-ID: <20110714202839.GN16618@brightrain.aerifal.cx> References: <20110714132437.507176ef@newbook> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1310675892 25917 80.91.229.12 (14 Jul 2011 20:38:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 14 Jul 2011 20:38:12 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-251-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jul 14 22:38:08 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1QhSfd-0003K6-KU for gllmg-musl@lo.gmane.org; Thu, 14 Jul 2011 22:38:05 +0200 Original-Received: (qmail 21896 invoked by uid 550); 14 Jul 2011 20:38:04 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 21876 invoked from network); 14 Jul 2011 20:38:03 -0000 Content-Disposition: inline In-Reply-To: <20110714132437.507176ef@newbook> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:167 Archived-At: 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