Skip to content

Commit

Permalink
Add LDFLAGS variable to Address Sanitizer example (conan-io#2241)
Browse files Browse the repository at this point in the history
It's deceptive to think this would work without linking to ASan.
  • Loading branch information
jwillikers authored Oct 5, 2021
1 parent 3071336 commit 20677d7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions howtos/sanitizers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Conan commands. An example of this would be a profile like:

.. code-block:: text
:caption: *address_sanitizer_profile*
:emphasize-lines: 10,12,13
:emphasize-lines: 10,12,13,14
[settings]
os=Macos
Expand All @@ -104,11 +104,12 @@ Conan commands. An example of this would be a profile like:
build_type=Release
compiler.sanitizer=Address
[env]
CXXFLAGS=-fsanitize=address
CFLAGS=-fsanitize=address
CXXFLAGS=-fsanitize=address
LDFLAGS=-fsanitize=address
Then calling to :command:`conan create . -pr address_sanitizer_profile` would inject
``-fsanitize=address`` to the build through the ``CXXFLAGS`` environment variable.
Then calling :command:`conan create . -pr address_sanitizer_profile` would inject
``-fsanitize=address`` to the build through the ``CFLAGS``, ``CXXFLAGS``, and ``LDFLAGS`` environment variables.

Managing sanitizer settings with the build system
#################################################
Expand Down

0 comments on commit 20677d7

Please sign in to comment.