mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Denys Vlasenko <vda.linux@googlemail.com>
To: musl <musl@lists.openwall.com>
Cc: Rich Felker <dalias@libc.org>
Subject: Re: Having hard time adding to CFLAGS
Date: Fri, 23 Oct 2015 02:13:53 +0200	[thread overview]
Message-ID: <CAK1hOcP4vPQOFJKrgRWg=rXYdhSLhzjqF9PbcYx+9uVyYRzHRw@mail.gmail.com> (raw)
In-Reply-To: <CAMAJcuCVmHqob6r9cF46jHGxxSkk4zE99JNpxsofCUqE-r-RvA@mail.gmail.com>

On Fri, Oct 23, 2015 at 1:04 AM, Josiah Worcester <josiahw@gmail.com> wrote:
> On Thu, Oct 22, 2015 at 3:31 PM Denys Vlasenko <vda.linux@googlemail.com>
> wrote:
>> Evidently, my CFLAGS replaced needed flags instead of being added at the
>> end.
>>
>> Can this be fixed? If user needs to use e.g. EXTRA_CFLAGS instead,
>> please fix configure --help.
>
>
> This appears to be an issue with how you're expecting CFLAGS to work.

I don't expect CFLAGS to work in any particular way. I would use whichever
variable musl build system's documentation tells me to
in order to add my own flags to gcc.

My point is, documentation does not tell me how to achieve that.

> As
> with almost anything with configure, all the optimization flags you want
> need to be in CFLAGS. Normally, a program would have nothing in there
> otherwise, so you'd be just getting the "-falign-functions=1" flag going to
> GCC. If you want to optimize it, you would actually need CFLAGS="-Os ...".

And I would need to know to add -fPIC etc, right?

Now, how would I make -fPIC appear *only where it is needed*?
The project may build some *.c files as part of a *library*
and therefore need -fPIC, and some other *.c files as a part
of a *binary*, where -fPIC is better not be used.

> As for the "no -fPIC", I believe you're looking at the build for two
> different objects.

No, I don't.


  reply	other threads:[~2015-10-23  0:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22 22:31 Denys Vlasenko
2015-10-22 23:04 ` Josiah Worcester
2015-10-23  0:13   ` Denys Vlasenko [this message]
2015-10-22 23:23 ` Szabolcs Nagy
2015-10-23  3:02   ` Rich Felker
2015-10-23  4:09     ` Rich Felker
2015-10-23  4:53       ` Denys Vlasenko
2015-10-23  5:16         ` Rich Felker
2015-10-23  6:47           ` Denys Vlasenko
2015-10-24 19:37             ` Rich Felker

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='CAK1hOcP4vPQOFJKrgRWg=rXYdhSLhzjqF9PbcYx+9uVyYRzHRw@mail.gmail.com' \
    --to=vda.linux@googlemail.com \
    --cc=dalias@libc.org \
    --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).