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>
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"