From ffb75e37f5099a09ab9e8271e05bf57783db2f6b Mon Sep 17 00:00:00 2001 From: Slava Barinov Date: Thu, 30 Apr 2020 17:27:23 +0300 Subject: [PATCH] packaging: Fix ASan build for armv7l Change-Id: I61ea1881efd00fd9377db78d4398311b01540b77 Signed-off-by: Slava Barinov --- packaging/glibc.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packaging/glibc.spec b/packaging/glibc.spec index ab155675..e08d04a 100644 --- a/packaging/glibc.spec +++ b/packaging/glibc.spec @@ -313,7 +313,7 @@ configure_and_build_glibc() { mkdir "cc-$dirname" cd "cc-$dirname" conf_cflags="$cflags -funwind-tables -fPIC" - %{?asan: conf_cflags="$conf_cflags -DASAN_INIT_FIRST "} + %{?asan: conf_cflags="$conf_cflags -DASAN_INIT_FIRST"} profile="--disable-profile" %if %{build_profile} @@ -360,6 +360,11 @@ build_asan() { unset CXXFLAGS unset CFLAGS unset LDFLAGS +%ifarch %arm + # Glibc must have both functions' implementations + CPPFLAGS="-U_LARGEFILE_SOURCE -U_LARGEFILE64_SOURCE -U_FILE_OFFSET_BITS" +%endif + #chmod +x $HERE/asan-glibc-gcc-wrapper.py #build static wrapper, because we don't want asan to intercept allocators g++ -o gcc-wrapper gcc-wrapper.cc -O3 -funroll-loops -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-exceptions -static @@ -368,6 +373,7 @@ build_asan() { mkdir -p $ASAN_BUILD cd $ASAN_BUILD # CC=$HERE/asan-glibc-gcc-wrapper.py $GLIBC/configure $configure_flags + CPPFLAGS=$CPPFLAGS \ CC=$HERE/gcc-wrapper $GLIBC/configure $configure_flags # Quick build - builds only libraries, but does not create symlinks. -- 2.7.4