mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Shiz <hi@shiz.me>
To: musl@lists.openwall.com
Subject: Re: [PATCH 2/2] build: overhaul wrapper script system for multiple wrapper support
Date: Mon, 1 Jun 2015 17:39:46 +0200	[thread overview]
Message-ID: <09CD8E2A-6438-48AC-9D60-F661471EE00F@shiz.me> (raw)
In-Reply-To: <20150601144744.GX17573@brightrain.aerifal.cx>

[-- Attachment #1: Type: text/plain, Size: 2633 bytes --]

> On 01 Jun 2015, at 16:47, Rich Felker <dalias@libc.org> wrote:
> 
> There are two reasons I prefer the approach I described:
> 
> 1. It's better not to auto-enable wrappers unless we're pretty
> confident they work. The wrappers are not magically universal; they're
> a way to use musl with a preexisting non-musl-targeted toolchain that
> meets a fairly large set of internal assumptions, and they won't
> necessarily work with arbitrary toolchains. In particular I'm pretty
> sure musl-gcc does not work with Rob's toolchains from Aboriginal
> Linux that are using their own wrapper (named gcc) around an internal
> gcc elsewhere, and presumably (being uclibc based) these would even be
> detected as "ok for wrapper”.

I’d like to note that a __GLIBC__ check would not help here either
presumably, as uclibc defines __GLIBC__ as well. :)

> 2, A false positive for enabling the wrapper (installing it on a
> musl-native system) is worse than a false-negative (omitting it) since
> native systems/cross-compilers are intended as the first-class usage
> case and wrappers are more of a demo/minor usage case. I can't safe
> for sure, but I suspect there might be minor breakage (versus a
> full-featured native toolchain) in using the wrappers on top of an
> already-native toolchain, and I don't want to ྀmislead users to do this
> by installing a script that looks like it's meant to be used.
> 
> I don't believe the dumpmachine approach is at all robust for gcc
> versions less than gcc 6 where musl support is upstream, and it's
> worse than the current dynamic linker check. There are no musl-cross
> patches at all for gcc versions prior to 4.0.3, whereas gcc3 works
> well and some dists (e.g. Sabotage) are even using it to bootstrap.

Understood, I wasn’t aware of this. On Gentoo’s musl profile, the gcc
CHOST is reconfigured to $arch-gentoo-linux-musl, so -dumpmachine works
as expected on every gcc it builds:

# gcc -dumpmachine
x86_64-gentoo-linux-musl

I assumed other musl distros would do something similar.

So I see your use case for testing in C code itself as opposed to testing
compiler features. That being said, I’m still not at all a fan of __GLIBC__,
for reasons mentioned in the previous post. While a false-positive is worse
than a false-negative, I feel just solely testing for this provides a large
opportunity for false-negatives, and even some false positives as you yourself
mentioned in point one.

It’s a tough thing to check thoroughly and accurately, but I do not think
checking __GLIBC__ is at all the solution either.

-S


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2015-06-01 15:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-29 16:48 [PATCH 1/2] add musl-clang, a wrapper for system clang installs Shiz
2015-05-29 16:55 ` [PATCH 2/2] build: overhaul wrapper script system for multiple wrapper support Shiz
2015-06-01  3:18   ` Rich Felker
2015-06-01 14:15     ` Shiz
2015-06-01 14:47       ` Rich Felker
2015-06-01 15:39         ` Shiz [this message]
2015-06-01 16:03           ` Rich Felker
2015-05-29 17:03 ` [PATCH 1/2] add musl-clang, a wrapper for system clang installs Rich Felker
2015-05-29 17:11   ` Shiz
2015-05-29 17:13     ` Rich Felker
2015-05-29 17:35       ` Shiz
2015-05-29 18:43 ` [PATCH v2] " Shiz

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=09CD8E2A-6438-48AC-9D60-F661471EE00F@shiz.me \
    --to=hi@shiz.me \
    --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).