[ARM32/Linux] Prepare rootfs to build libcoreclrtraceptprovider.so
authorHyeongseok Oh <hseok82.oh@samsung.com>
Thu, 2 Mar 2017 05:01:18 +0000 (14:01 +0900)
committerHyeongseok Oh <hseok82.oh@samsung.com>
Thu, 2 Mar 2017 05:01:18 +0000 (14:01 +0900)
Prepare rootfs to build libcoreclrtraceptprovider.so
by adding fix process of rootfs for ubuntu 14.04 armhf

cross/arm/trusty.patch [new file with mode: 0644]
cross/build-rootfs.sh

diff --git a/cross/arm/trusty.patch b/cross/arm/trusty.patch
new file mode 100644 (file)
index 0000000..2f2972f
--- /dev/null
@@ -0,0 +1,97 @@
+diff -u -r a/usr/include/urcu/uatomic/generic.h b/usr/include/urcu/uatomic/generic.h
+--- a/usr/include/urcu/uatomic/generic.h       2014-03-28 06:04:42.000000000 +0900
++++ b/usr/include/urcu/uatomic/generic.h       2017-02-13 10:35:21.189927116 +0900
+@@ -65,17 +65,17 @@
+       switch (len) {
+ #ifdef UATOMIC_HAS_ATOMIC_BYTE
+       case 1:
+-              return __sync_val_compare_and_swap_1(addr, old, _new);
++              return __sync_val_compare_and_swap_1((uint8_t *) addr, old, _new);
+ #endif
+ #ifdef UATOMIC_HAS_ATOMIC_SHORT
+       case 2:
+-              return __sync_val_compare_and_swap_2(addr, old, _new);
++              return __sync_val_compare_and_swap_2((uint16_t *) addr, old, _new);
+ #endif
+       case 4:
+-              return __sync_val_compare_and_swap_4(addr, old, _new);
++              return __sync_val_compare_and_swap_4((uint32_t *) addr, old, _new);
+ #if (CAA_BITS_PER_LONG == 64)
+       case 8:
+-              return __sync_val_compare_and_swap_8(addr, old, _new);
++              return __sync_val_compare_and_swap_8((uint64_t *) addr, old, _new);
+ #endif
+       }
+       _uatomic_link_error();
+@@ -100,20 +100,20 @@
+       switch (len) {
+ #ifdef UATOMIC_HAS_ATOMIC_BYTE
+       case 1:
+-              __sync_and_and_fetch_1(addr, val);
++              __sync_and_and_fetch_1((uint8_t *) addr, val);
+               return;
+ #endif
+ #ifdef UATOMIC_HAS_ATOMIC_SHORT
+       case 2:
+-              __sync_and_and_fetch_2(addr, val);
++              __sync_and_and_fetch_2((uint16_t *) addr, val);
+               return;
+ #endif
+       case 4:
+-              __sync_and_and_fetch_4(addr, val);
++              __sync_and_and_fetch_4((uint32_t *) addr, val);
+               return;
+ #if (CAA_BITS_PER_LONG == 64)
+       case 8:
+-              __sync_and_and_fetch_8(addr, val);
++              __sync_and_and_fetch_8((uint64_t *) addr, val);
+               return;
+ #endif
+       }
+@@ -139,20 +139,20 @@
+       switch (len) {
+ #ifdef UATOMIC_HAS_ATOMIC_BYTE
+       case 1:
+-              __sync_or_and_fetch_1(addr, val);
++              __sync_or_and_fetch_1((uint8_t *) addr, val);
+               return;
+ #endif
+ #ifdef UATOMIC_HAS_ATOMIC_SHORT
+       case 2:
+-              __sync_or_and_fetch_2(addr, val);
++              __sync_or_and_fetch_2((uint16_t *) addr, val);
+               return;
+ #endif
+       case 4:
+-              __sync_or_and_fetch_4(addr, val);
++              __sync_or_and_fetch_4((uint32_t *) addr, val);
+               return;
+ #if (CAA_BITS_PER_LONG == 64)
+       case 8:
+-              __sync_or_and_fetch_8(addr, val);
++              __sync_or_and_fetch_8((uint64_t *) addr, val);
+               return;
+ #endif
+       }
+@@ -180,17 +180,17 @@
+       switch (len) {
+ #ifdef UATOMIC_HAS_ATOMIC_BYTE
+       case 1:
+-              return __sync_add_and_fetch_1(addr, val);
++              return __sync_add_and_fetch_1((uint8_t *) addr, val);
+ #endif
+ #ifdef UATOMIC_HAS_ATOMIC_SHORT
+       case 2:
+-              return __sync_add_and_fetch_2(addr, val);
++              return __sync_add_and_fetch_2((uint16_t *) addr, val);
+ #endif
+       case 4:
+-              return __sync_add_and_fetch_4(addr, val);
++              return __sync_add_and_fetch_4((uint32_t *) addr, val);
+ #if (CAA_BITS_PER_LONG == 64)
+       case 8:
+-              return __sync_add_and_fetch_8(addr, val);
++              return __sync_add_and_fetch_8((uint64_t *) addr, val);
+ #endif
+       }
+       _uatomic_link_error();
index 4b695ab..d1d79bb 100755 (executable)
@@ -140,6 +140,12 @@ if [[ -n $__LinuxCodeName ]]; then
     if [ $__SkipUnmount == 0 ]; then
         umount $__RootfsDir/*
     fi
+
+    if [[ "$__BuildArch" == "arm" && "$__LinuxCodeName" == "trusty" ]]; then
+        pushd $__RootfsDir
+        patch -p1 < $__CrossDir/$__BuildArch/trusty.patch
+        popd
+    fi
 elif [ "$__Tizen" == "tizen" ]; then
     ROOTFS_DIR=$__RootfsDir $__CrossDir/$__BuildArch/tizen-build-rootfs.sh
 else