packaging: Fix ASan build for armv7l
authorSlava Barinov <v.barinov@samsung.com>
Thu, 30 Apr 2020 14:27:23 +0000 (17:27 +0300)
committerDongkyun Son <dongkyun.s@samsung.com>
Wed, 3 May 2023 10:48:39 +0000 (19:48 +0900)
Change-Id: I61ea1881efd00fd9377db78d4398311b01540b77
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
packaging/glibc.spec

index ab15567..e08d04a 100644 (file)
@@ -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.