Page MenuHomePhabricator

Fixes `--enable-asan` compilation in MacOS
ClosedPublic

Authored by matiu on May 9 2018, 20:10.

Details

Summary

This fixes --enable-asan linkage for MacOS.

--fsanitize=address is not passed by default by libtool when linking libbitcoinconsesus, probably because of https://www.gnu.org/software/libtool/manual/html_node/Stripped-link-flags.html

By simply adding the flag in LIBTOOL_APP_LDFLAGS, the option is pass, and the library created successfully.

For Address sanitation, it is necesary to disable assembly (--disable-asm) in MacOS, the llvm compiler doesnt seem to understand the inline asm format with using --enable-asan, not sure why.

Test Plan

./configure --enable-asan --disable-asm && make && ./src/test/test_bitcoin

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

matiu created this revision.May 9 2018, 20:10
Herald added a reviewer: Restricted Project. · View Herald TranscriptMay 9 2018, 20:10
schancel added a subscriber: schancel.May 9 2018, 20:16

Are we doing anything about these builds under cmake?

deadalnix added inline comments.
configure.ac
242 ↗(On Diff #3855)

This doesn't seems like the right place to add this.

253 ↗(On Diff #3855)

Here seems more appropriate.

matiu updated this revision to Diff 3873.May 10 2018, 18:45

More LIBTOOL_APP_LDFLAGS config to a more appropiate place

deadalnix accepted this revision.May 11 2018, 22:35
This revision is now accepted and ready to land.May 11 2018, 22:35
This revision was automatically updated to reflect the committed changes.