From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10660 Path: news.gmane.org!.POSTED!not-for-mail From: Samuel Sadok Newsgroups: gmane.linux.lib.musl.general Subject: Re: Unable to build with --enable-shared Date: Sun, 23 Oct 2016 02:22:28 +0200 Message-ID: References: <20161022215829.GA5749@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1477182171 10516 195.159.176.226 (23 Oct 2016 00:22:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 23 Oct 2016 00:22:51 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10673-gllmg-musl=m.gmane.org@lists.openwall.com Sun Oct 23 02:22:45 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1by6Yi-0001Ly-JS for gllmg-musl@m.gmane.org; Sun, 23 Oct 2016 02:22:40 +0200 Original-Received: (qmail 32062 invoked by uid 550); 23 Oct 2016 00:22:41 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 32044 invoked from network); 23 Oct 2016 00:22:41 -0000 X-Authenticated-Sender-Id: innovation-labs@appinstall.ch X-Gm-Message-State: ABUngvd1NxgX32FgLJ6stbtFv79kz2x4h2usog0Jv6jY9ipSJ5PIPH1X0mdpU3xuBWulnCDoWQ0p3+HQfZKEPw== X-Received: by 10.25.33.79 with SMTP id h76mr3565052lfh.133.1477182148908; Sat, 22 Oct 2016 17:22:28 -0700 (PDT) In-Reply-To: <20161022215829.GA5749@port70.net> X-Gmail-Original-Message-ID: Xref: news.gmane.org gmane.linux.lib.musl.general:10660 Archived-At: 2016-10-22 23:58 GMT+02:00 Szabolcs Nagy : > * Samuel Sadok [2016-10-22 22:37:46 +0200]: >> I am unable to build musl with --enable-shared. Multiple issues in >> unrelated projects (e.g. here: https://bugs.swift.org/browse/SR-1023) >> suggest that the culprit is a change in behaviour between binutils >> 2.25 and 2.26. >> > > that bug is different, that's about object symbols > > (swift seems to misuse protected visibility objects, > and instead of fixing the problem they switched to the > gold linker which does not yet have the bfd linker fix, > such incompetence is frustrating.. however the issue > does not affect musl: we don't mark objects protected > to avoid issues with broken toolchains.) That's precisely why I'm trying to get away from Apple. > >> $ make >> [...] >> x86_64-pc-linux-gnu-gcc -D_XOPEN_SOURCE=700 -I./arch/x86_64 >> -I./arch/generic -Iobj/src/internal -I./src/internal -Iobj/include >> -I./include -include vis.h -B/usr/local/bin/x86_64-pc-linux-gnu- >> -fPIC -c -o obj/src/process/posix_spawn.lo src/process/posix_spawn.c > > some flags are missing here.. e.g. freestanding flags Thanks for the pointer, that turned out to be the problem. I should mention that I am cross-compiling from macOS. Since I had a Linux VM flying around, I tried to build musl there (success) and compared the logs. Looking at config.mak, there apparently was a serious misconfiguration: config.mak on the cross-build system (macOS): CFLAGS_AUTO = -include vis.h CFLAGS_C99FSE = CFLAGS_MEMOPS = CFLAGS_NOSSP = LDFLAGS_AUTO = LIBCC = config.mak on Ubuntu: CFLAGS_AUTO = -Os -pipe -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith -include vis.h CFLAGS_C99FSE = -std=c99 -nostdinc -ffreestanding -fexcess-precision=standard -frounding-math -Wa,--noexecstack CFLAGS_MEMOPS = -fno-tree-loop-distribute-patterns CFLAGS_NOSSP = -fno-stack-protector LDFLAGS_AUTO = -Wl,--sort-section,alignment -Wl,--sort-common -Wl,--gc-sections -Wl,--hash-style=both -Wl,--no-undefined -Wl,--exclude-libs=ALL -Wl,-Bsymbolic-functions LIBCC = -lgcc -lgcc_eh After adding the missing flags (except the seemingly unused -lgcc_eh), the build succeeded on macOS. I'm not sure if this can be fixed cleanly by passing appropriate arguments to configure or if the script should be patched. My experience with configure scripts is limited, but I will try to look further into what went wrong exactly.