Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: allow passing through LDFLAGS to final link phase #5423

Merged
merged 1 commit into from Jan 2, 2018
Merged

Makefile: allow passing through LDFLAGS to final link phase #5423

merged 1 commit into from Jan 2, 2018

Conversation

trofi
Copy link
Contributor

@trofi trofi commented Dec 21, 2017

While at it allow verbose builds: handy to see what crystal
is doing when doing release builds for 20 minutes.

Signed-off-by: Sergei Trofimovich slyfox@gentoo.org

@RX14
Copy link
Contributor

RX14 commented Dec 21, 2017

The best tool for seeing what crystal is doing in a release build is either --progress or --stats. I'm not sure --verbose is very useful apart from debugging but we might as well include it. We should document the verbose variable at the top, just like release is documented on lime 18 though.

I'm not as sure about the LDFLAGS change but I suppose it's probably a good idea.

LDFLAGS allows distributions to pass their specific flags.
LDFLAGS is a typical variable along with CC/CXX/AR commonly
seen in autotools projects.

For example Gentoo uses:
    LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"

That way all the final binaries include GNU-style symbol hashing
and omit unused dynamic libraries (llvm has a lot of thse).
It's also handy to pass things like "-Wl,-z,now" to force early
symbol binding.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
@trofi
Copy link
Contributor Author

trofi commented Dec 21, 2017

Aha! I'll try progress again.

I think I wanted verbose= to see tools and their arguments are called by crystal binary like ar and ld. verbose was already handled for testsuite runs thus I piggy-backed on it. I've dropped verbose from proposed change for now.

Also expanded use case of LDFLAGS in commit message. Does it make more sense now?

@RX14 RX14 added this to the Next milestone Jan 2, 2018
@RX14 RX14 merged commit 3661e2d into crystal-lang:master Jan 2, 2018
lukeasrodgers pushed a commit to lukeasrodgers/crystal that referenced this pull request Jan 7, 2018
…lang#5423)

LDFLAGS allows distributions to pass their specific flags.
LDFLAGS is a typical variable along with CC/CXX/AR commonly
seen in autotools projects.

For example Gentoo uses:
    LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"

That way all the final binaries include GNU-style symbol hashing
and omit unused dynamic libraries (llvm has a lot of thse).
It's also handy to pass things like "-Wl,-z,now" to force early
symbol binding.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants