Author Jeffrey.Walton
Recipients Jeffrey.Walton
Date 2014-03-15.16:14:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
From Python head in mercurial.

When building Python under Clang's sanitizers, we provide a couple of flags to instrument binaries with the sanitizers. For example:

export CC=/usr/local/bin/clang
export CXX=/usr/local/bin/clang++
export CFLAGS="-g3 -fsanitize=undefined -fsanitize=address"
export CXXFLAGS="-g3 -fsanitize=undefined -fsanitize=address -fno-sanitize=vptr"

However, `make` will fail due to some missing sanitizer libraries. The libraries are added at the link stage by Clang, but the invocation must include the -fsanitize=... flags.

The recipe for $(BUILDPYTHON) in the Makefile does not include necessary CFLAGS:

# Build the interpreter

The result is a failed link when building with the sanitizers.

It would be great if the sanizter flags (-fsanitize=undefined -fsanitize=address -fno-sanitize=vptr) were cherry picked from the FLAGS by the build system and added to the recipe as required:

	$(LINKCC) -fsanitize=undefined -fsanitize=address -fno-sanitize=vptr $(PY_LDFLAGS) $(LINKFORSHARED) ...

Please consider picking up the sanitizer flags and adding them to the build rule.
Date User Action Args
2014-03-15 16:14:35Jeffrey.Waltonsetrecipients: + Jeffrey.Walton
2014-03-15 16:14:35Jeffrey.Waltonsetmessageid: <>
2014-03-15 16:14:35Jeffrey.Waltonlinkissue20935 messages
2014-03-15 16:14:35Jeffrey.Waltoncreate