arch: Fixed /usr/include/asm to build 32bit packages on 64bit Linux 04/227904/2 accepted/tizen/base/20200325.053342 submit/tizen_base/20200319.050442
authorGeunsik Lim <geunsik.lim@samsung.com>
Mon, 9 Mar 2020 11:36:01 +0000 (20:36 +0900)
committerDongkyun Son <dongkyun.s@samsung.com>
Thu, 19 Mar 2020 04:52:52 +0000 (04:52 +0000)
commit570c44ed57f1174accc3258ce0b1d2f7c515c726
tree8783c388d561c7155a40f40277816cfaf5944e1f
parentc6167fc049c3b032b069ecf3c56b4294adb54968
arch: Fixed /usr/include/asm to build 32bit packages on 64bit Linux

This commit is to handle a different attribute of CPU architectures
between kernel-space and user-space. For example, the Tizen platform
6.0 consists the ARM64-based Linux kernel and ARM32-based Tizen
platform packages. When the developer want to compile the user-space
software packages to support a ARM32 bit CPU architecture, they meet
an unexpected issue because the 'linux-glibc-devel' package is installed
based on CPU architecture of the Linux kernel on the real target board.

Therefore, we need to improve the compatibility of the user-space software
packages based on 32bit CPU architecture. Let's replace the criteria from
"uname -m" command to "%_arch" macro.

Let's assume that the Tizen 6.0 platform is based on ARM32,
and the Tizen Linux kernel is based on ARM64 bit (arm64/aarch64).

**Changelog**
* Version 3:
  - Removed "BuildArch: noarch" statement to handle correctly different
    architecure attribute of /usr/include/asm (symlink)

* Version 2:
  - Use '_arch' instead of tizen-release package to avoid a build issue
    (Note that this package does not use the Unified repository.)
  - Fixed typos
  - Added annotation for maintenance

* Version 1:
  - Replaced "uname -m" with "/etc/tizen-release"

**Self assessment**
* Checking asm_link variable in the post section
$ rpm -qp --scripts ./linux-glibc-devel-3.10-0.aarch64.rpm | grep asm_link
asm_link=aarch64

$ rpm -qp --scripts ./linux-glibc-devel-3.10-0.armv7l.rpm  | grep asm_link
asm_link=arm

* On Tizen 6.0 (32bit) after this commit: It's incorrect.
sh-3.2# ls -al /usr/include/asm
lrwxrwxrwx 1 root root 7 Mar  4 14:26 /usr/include/asm -> asm-arm64

* On Tizen 6.0 (32bit) after this commit: It's correct.
sh-3.2# ls -al /usr/include/asm
lrwxrwxrwx 1 root root 7 Mar  9 19:38 /usr/include/asm -> asm-arm

Change-Id: I8c25d840d7558db16b6a92c728555ed1c6a24891
Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
packaging/linux-glibc-devel.spec