grsecurity-3.1-4.4.4-201603032158 build failures on armv7

Discuss usability issues, general maintenance, and general support issues for a grsecurity-enabled system.

grsecurity-3.1-4.4.4-201603032158 build failures on armv7

Postby coadde » Mon Mar 07, 2016 3:07 am

Hi,

I ran in to a couple problems building with grsec and 4.4.4 for armv7.

Code: Select all
In file included from include/linux/atomic.h:562:0,
                 from include/linux/spinlock.h:417,
                 from include/linux/seqlock.h:35,
                 from include/linux/time.h:5,
                 from include/uapi/linux/timex.h:56,
                 from include/linux/timex.h:56,
                 from include/linux/sched.h:19,
                 from arch/arm/kernel/asm-offsets.c:14:
include/asm-generic/atomic-long.h: In function 'atomic_long_inc_return_unchecked':
include/asm-generic/atomic-long.h:45:28: error: implicit declaration of function 'atomic_inc_return_unchecked' [-Werror=implicit-function-declaration]
 #define ATOMIC_LONG_PFX(x) atomic ## x
                            ^
include/asm-generic/atomic-long.h:203:15: note: in expansion of macro 'ATOMIC_LONG_PFX'
  return (long)ATOMIC_LONG_PFX(_##op##_return##mo##suffix)(v); \
               ^
include/asm-generic/atomic-long.h:206:1: note: in expansion of macro 'ATOMIC_LONG_INC_DEC_OP'
 ATOMIC_LONG_INC_DEC_OP(inc,,_unchecked)
 ^


I'm building from GCC 5.3.0 with libstdc++ switched to the new ABI [0], since it's being building for Parabola (distro based on Arch).

[0]:https://www.archlinux.org/news/c-abi-change/
coadde
 
Posts: 4
Joined: Mon Mar 07, 2016 2:01 am

Re: grsecurity-3.1-4.4.4-201603032158 build failures on armv

Postby PaX Team » Thu Mar 10, 2016 9:14 pm

can you try the following patch:
Code: Select all
--- a/include/linux/atomic.h       2016-01-11 01:28:05.922032900 +0100
+++ b/include/linux/atomic.h      2016-03-11 02:11:40.632808892 +0100
@@ -103,6 +103,11 @@
 #define  atomic_inc_return(...)                                                \
        __atomic_op_fence(atomic_inc_return, __VA_ARGS__)
 #endif
+
+#ifndef atomic_inc_return_unchecked
+#define  atomic_inc_return_unchecked(...)                              \
+       __atomic_op_fence(atomic_inc_return_unchecked, __VA_ARGS__)
+#endif
 #endif /* atomic_inc_return_relaxed */

 /* atomic_sub_return_relaxed */
@@ -255,6 +260,11 @@
 #define  atomic64_inc_return(...)                                      \
        __atomic_op_fence(atomic64_inc_return, __VA_ARGS__)
 #endif
+
+#ifndef atomic64_inc_return_unchecked
+#define  atomic64_inc_return_unchecked(...)                            \
+       __atomic_op_fence(atomic64_inc_return_unchecked, __VA_ARGS__)
+#endif
 #endif /* atomic64_inc_return_relaxed */


PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Re: grsecurity-3.1-4.4.4-201603032158 build failures on armv

Postby coadde » Wed Mar 16, 2016 5:51 pm

PaX Team wrote:can you try the following patch:
Code: Select all
--- a/include/linux/atomic.h       2016-01-11 01:28:05.922032900 +0100
+++ b/include/linux/atomic.h      2016-03-11 02:11:40.632808892 +0100
@@ -103,6 +103,11 @@
 #define  atomic_inc_return(...)                                                \
        __atomic_op_fence(atomic_inc_return, __VA_ARGS__)
 #endif
+
+#ifndef atomic_inc_return_unchecked
+#define  atomic_inc_return_unchecked(...)                              \
+       __atomic_op_fence(atomic_inc_return_unchecked, __VA_ARGS__)
+#endif
 #endif /* atomic_inc_return_relaxed */

 /* atomic_sub_return_relaxed */
@@ -255,6 +260,11 @@
 #define  atomic64_inc_return(...)                                      \
        __atomic_op_fence(atomic64_inc_return, __VA_ARGS__)
 #endif
+
+#ifndef atomic64_inc_return_unchecked
+#define  atomic64_inc_return_unchecked(...)                            \
+       __atomic_op_fence(atomic64_inc_return_unchecked, __VA_ARGS__)
+#endif
 #endif /* atomic64_inc_return_relaxed */




Thanks, now it works!! Emulatorman pushed your patch to build linux-libre-grsec and linux-libre-grsec-knock for Parabola ARM [0]

[0]:https://projects.parabola.nu/abslibre.git/commit/?id=542b443def2fecfd19f88f4f85f0473eb445236d
coadde
 
Posts: 4
Joined: Mon Mar 07, 2016 2:01 am

Re: grsecurity-3.1-4.4.4-201603032158 build failures on armv

Postby PaX Team » Wed Mar 16, 2016 6:04 pm

it's already part of grsec, so you should just update to it ;).
PaX Team
 
Posts: 2310
Joined: Mon Mar 18, 2002 4:35 pm

Re: grsecurity-3.1-4.4.4-201603032158 build failures on armv

Postby coadde » Wed Mar 16, 2016 6:06 pm

PaX Team wrote:it's already part of grsec, so you should just update to it ;).


ok, thanks so much!
coadde
 
Posts: 4
Joined: Mon Mar 07, 2016 2:01 am


Return to grsecurity support