From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: [PATCH] configure: check whether linker works too
Date: Tue, 25 Oct 2016 11:13:24 +0200 [thread overview]
Message-ID: <20161025091324.GB5749@port70.net> (raw)
In-Reply-To: <ce702cb3-a9d9-50c5-c3d1-9e8892e2d091@gmail.com>
* Laine Gholson <laine.gholson@gmail.com> [2016-10-24 19:00:55 -0500]:
> +if test x"$shared" != xno ; then
> + printf "checking whether linker works... "
> + echo "int main(void) { return 0; }" > "$tmpc"
> + if output=$($CC -nostdlib -shared -o /dev/null "$tmpc" 2>&1) ; then
a shared lib does not need main (it does not hurt though).
> + printf "yes\n"
> + else
> + if test x"$shared" = xyes ; then
> + printf "no; compiler output follows:\n%s\n" "$output"
> + exit 1
> + else
> + printf "no; shared library disabled\n"
> + shared=no
> + fi
this silently succeeds with default options when the
linker is broken (does not match documented behaviour).
> + fi
> +fi
> +
> +printf "checking whether CFLAGS and CPPFLAGS are sane... "
> +echo "typedef int x;" > "$tmpc"
> +if output=$($CC $CFLAGS $CPPFLAGS -c -o /dev/null "$tmpc" 2>&1) ; then
there is some copy-paste repetition in these checks,
i think it could be refactored in a cleaner way.
(like tryflag etc)
prev parent reply other threads:[~2016-10-25 9:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-24 23:05 Laine Gholson
2016-10-24 23:23 ` Rich Felker
2016-10-25 0:00 ` Laine Gholson
2016-10-25 9:13 ` Szabolcs Nagy [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=20161025091324.GB5749@port70.net \
--to=nsz@port70.net \
--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).