Use linker-arguments only when linking #1514

pull muggenhor wants to merge 1 commits into bitcoin:master from muggenhor:fix-commandline-warnings changing 1 files +9 −4
  1. muggenhor commented at 12:04 PM on June 24, 2012: contributor

    Passing linker-arguments when only compiling will cause warnings with Clang. This change fixes those.

    Specifically this addresses warnings like these:

    clang: warning: -Wl,-z,relro: 'linker' input unused when '-c' is present
    clang: warning: -Wl,-z,now: 'linker' input unused when '-c' is present
    clang: warning: argument unused during compilation: '-pie'
    
  2. jgarzik commented at 2:23 PM on June 24, 2012: contributor

    why not use LDFLAGS?

  3. muggenhor commented at 3:08 PM on June 24, 2012: contributor

    The reason was to prevent overriding LDFLAGS given on the command-line, but I've addressed this by using the same trick as for CXXFLAGS.

  4. in src/makefile.unix:None in 3c07f5a4f4 outdated
     135 | @@ -131,7 +136,7 @@ obj/%.o: %.cpp
     136 |  	  rm -f $(@:%.o=%.d)
     137 |  
     138 |  bitcoind: $(OBJS:obj/%=obj/%)
     139 | -	$(CXX) $(xCXXFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)
     140 | +	$(CXX) $(xCXXFLAGS) $(LDHARDENING) -o $@ $^ $(xLDFLAGS) $(LIBS)
    


    sipa commented at 4:11 PM on June 24, 2012:

    $(LDHARDENING) is already included in $(xLDFLAGS), it seems.


    muggenhor commented at 4:21 PM on June 24, 2012:

    Oh, that was a bad left-over. Removed it and re-pushed.

  5. gavinandresen commented at 7:23 PM on June 28, 2012: contributor

    ACK

  6. TheBlueMatt commented at 5:56 PM on July 4, 2012: member

    Can you rebase and remove the merge commit? Also, ACK and can we get this merged so it doesn't sit around forever? Also, clang's lto is petty awesome with Bitcoin, I got these earlier today with bitcoin-qt: clang-lto: " block index 6523ms" gcc-lto: " block index 8497ms" For that reason, I'd kinda like to look into building releases with clang, but we need this.

  7. laanwj commented at 8:18 AM on July 8, 2012: member

    ACK

  8. Use linker-arguments only when linking
    Passing linker-arguments when only compiling will cause warnings with
    Clang. This change fixes those.
    
    Signed-off-by: Giel van Schijndel <me@mortis.eu>
    f04f24503d
  9. muggenhor commented at 11:54 PM on July 16, 2012: contributor

    Rebased (again), and (still) ready for merge.

  10. gavinandresen merged this on Jul 17, 2012
  11. gavinandresen closed this on Jul 17, 2012

  12. suprnurd referenced this in commit 397ea95dbb on Dec 5, 2017
  13. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 06:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me