Tizen/Dist: Handle ASAN flag (-fno-common) of latest Tizen compiler 17/242817/1 accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix accepted/tizen_6.5_unified accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified tizen_6.0 tizen_6.0_hotfix tizen_6.5 tizen_7.0 tizen_7.0_hotfix tizen_8.0 accepted/tizen/6.0/unified/20201030.112211 accepted/tizen/6.0/unified/hotfix/20201102.231913 accepted/tizen/6.5/unified/20211028.224522 accepted/tizen/7.0/unified/20221110.060431 accepted/tizen/7.0/unified/hotfix/20221116.111214 accepted/tizen/8.0/unified/20231005.095304 accepted/tizen/unified/20200914.131300 accepted/tizen/unified/dev/20240620.011003 submit/tizen/20200901.074738 submit/tizen/20200914.045102 submit/tizen_6.0/20201029.205503 submit/tizen_6.0_hotfix/20201102.192903 submit/tizen_6.0_hotfix/20201103.115103 submit/tizen_6.5/20211028.163601 tizen_6.0.m2_release tizen_6.5.m2_release tizen_7.0_m2_release tizen_8.0_m2_release
authorGeunsik Lim <geunsik.lim@samsung.com>
Tue, 1 Sep 2020 05:35:40 +0000 (14:35 +0900)
committerGeunsik Lim <geunsik.lim@samsung.com>
Tue, 1 Sep 2020 05:37:13 +0000 (14:37 +0900)
This commit handles the -fno-common flag of up-to-date Tizen compiler (GCC).
In case of Opensource project, it is to restore the existing -fcommon flag.

* Reference:
  * https://wiki.tizen.org/ASan
    - “multiple definition of” linking error due to -fno-common

* Build issue:
  ... Omission ...
/usr/lib/gcc/armv7l-tizen-linux-gnueabi/9.2.0/../../../../armv7l-tizen-linux-gnueabi/
bin/ld: session.o:/home/abuild/rpmbuild/BUILD/openssh-7.7p1/session.c:144: multiple
definition of `tun_fwd_ifnames'; serverloop.o:/home/abuild/rpmbuild/BUILD/
openssh-7.7p1/serverloop.c:104: first defined here

Change-Id: I40ab91b53798aa352c8d40fbd9c761de56ead96a
Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
packaging/openssh.spec

index 2d265a9..dcde423 100644 (file)
@@ -58,6 +58,9 @@ also be forwarded over the secure channel.
 cp %{SOURCE1001} .
 
 %build
+# https://wiki.tizen.org/ASan#.E2.80.9Cmultiple_definition_of.E2.80.9D_linking_error_due_to_-fno-common
+%{?asan:%restore_fcommon}
+
 autoreconf -fiv
 PIEFLAGS="-fpie"
 export CFLAGS="%{optflags} $PIEFLAGS -fstack-protector"