Skip to contentSkip to conversation

Fix our defconfigs (branch yem/fix-defconfigs)

PATCH New Yann E. MORIN 2 participants 6 messages Aug 7, 2016

lore
Share & tools
lore
#0 lore raw

cover Fix our defconfigs (branch yem/fix-defconfigs)

Hello All!

This series fixes most build failures for our defconfigs:

- patch 1 fixes kb9202 after we changed the way we handled the kernel

    headers selection to default to the built kernel;

- patch 2 fixes the build of uboot for the snps defconfigs, as it

    needs dtc;

- patch 3 fixes all our thumb2-only altera and atmel defconfigs, by reverting an upstream commit that broke the build.

There are a two other build failures for demo-like defconfigs. Those are not yet fixed.

Series meant to fix failures seen with Travis:

    https://travis-ci.org/buildroot/buildroot-defconfig-testing/builds/150333638

Regards,
Yann E. MORIN.

The following changes since commit 023bba7797132713c9e656cd45846596a2b16bf5

package/hidapi: depends on NPTL threads (2016-08-06 23:59:38 +0200)

are available in the git repository at:

https://gitlab.com/ymorin/buildroot.git

for you to fetch changes up to f410a42ac202f8266ff8f4ace32f97e5c68ac0fe

pcakage/uclibc: fix build on thumb2-only arm cpus (2016-08-07 22:39:30 +0200)

----------------------------------------------------------------
Yann E. MORIN (3):
defconfigs/kb9202: fix headers version defconfigs/snps_axs_10*: uboot needs dtc pcakage/uclibc: fix build on thumb2-only arm cpus

 configs/kb9202_defconfig                           |   3 +-
 configs/snps_axs101_defconfig                      |   1 +
 configs/snps_axs103_defconfig                      |   1 +
 ...arm-cleanup-redundant-macros-for-syscalls.patch | 150 +++++++++++++++++++++
 4 files changed, 154 insertions(+), 1 deletion(-)
 create mode 100644 package/uclibc/0001-Revert-arm-cleanup-redundant-macros-for-syscalls.patch
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH 1/3 defconfigs/kb9202: fix headers version

Fixes:

    https://travis-ci.org/buildroot/buildroot-defconfig-testing/jobs/150333697
---
 configs/kb9202_defconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
configs/kb9202_defconfig +2 -1
index c38adbf..0aea0eb 100644
@@ -5,7 +5,8 @@ BR2_arm920t=y
 # Filesystem
 BR2_TARGET_ROOTFS_TAR=y
 
-# Linux headers same as kernel, a 2.6 series (so, no option selected)
+# Linux headers same as kernel, a 2.6 series
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_REALLY_OLD=y
 
 # Kernel
 BR2_LINUX_KERNEL=y
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/3 defconfigs/snps_axs_10*: uboot needs dtc

In reply to Yann E. MORIN

Fixes:

    https://travis-ci.org/buildroot/buildroot-defconfig-testing/jobs/150333758
    https://travis-ci.org/buildroot/buildroot-defconfig-testing/jobs/150333759
---
 configs/snps_axs101_defconfig | 1 +
 configs/snps_axs103_defconfig | 1 +
 2 files changed, 2 insertions(+)
configs/snps_axs101_defconfig +1 -0
index f7bcf4d..f272853 100644
@@ -23,3 +23,4 @@ BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.07"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="axs101"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
configs/snps_axs103_defconfig +1 -0
index 840db74..75596c9 100644
@@ -24,3 +24,4 @@ BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.07"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="axs103"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/3 pcakage/uclibc: fix build on thumb2-only arm cpus

In reply to Yann E. MORIN

Add a patch to revert an upstream commit that broke building for armv7 thumb2-only CPUs.

Commit pointed out by Thomas.

Fixes:

    https://travis-ci.org/buildroot/buildroot-defconfig-testing/jobs/150333657
    https://travis-ci.org/buildroot/buildroot-defconfig-testing/jobs/150333658
    ... and all the other atmel_sama5d* defconfigs
    https://travis-ci.org/buildroot/buildroot-defconfig-testing/jobs/150333643
    https://travis-ci.org/buildroot/buildroot-defconfig-testing/jobs/150333644
Cc Thomas Petazzoni <[email protected]>
---
 ...arm-cleanup-redundant-macros-for-syscalls.patch | 150 +++++++++++++++++++++
 1 file changed, 150 insertions(+)
 create mode 100644 package/uclibc/0001-Revert-arm-cleanup-redundant-macros-for-syscalls.patch
package/uclibc/0001-Revert-arm-cleanup-redundant-macros-for-syscalls.patch new file +150 -0
new file mode 100644
index 0000000..184dc62
@@ -0,0 +1,150 @@
+From cdac8bef6b8e94518f78f2e9182cb3fa0f78a57b Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Sun, 7 Aug 2016 21:52:46 +0200
+Subject: [PATCH] Revert "arm: cleanup redundant macros for syscalls"
+
+This reverts commit 0550ecce0e6580c5ad34e9a9a39ff18ccf8774f9.
+---
+ libc/sysdeps/linux/arm/bits/syscalls.h |   4 --
+ libc/sysdeps/linux/arm/sysdep.h        | 111 +++++++++++++++++++++++++++++++++
+ 2 files changed, 111 insertions(+), 4 deletions(-)
+
+diff --git a/libc/sysdeps/linux/arm/bits/syscalls.h b/libc/sysdeps/linux/arm/bits/syscalls.h
+index 5b30564..e447a7b 100644
+--- a/libc/sysdeps/linux/arm/bits/syscalls.h
++++ b/libc/sysdeps/linux/arm/bits/syscalls.h
+@@ -83,10 +83,6 @@
+      }									\
+      (int) __internal_sys_result; }) \
+ )
+-
+-#undef INTERNAL_SYSCALL_ARM
+-#define INTERNAL_SYSCALL_ARM(name, err, nr, args...)           \
+-	INTERNAL_SYSCALL_NCS(__ARM_NR_##name, err, nr, args)
+ #endif
+ 
+ #define INTERNAL_SYSCALL_ERROR_P(val, err) \
+diff --git a/libc/sysdeps/linux/arm/sysdep.h b/libc/sysdeps/linux/arm/sysdep.h
+index 80bf9ec..65d9c2b 100644
+--- a/libc/sysdeps/linux/arm/sysdep.h
++++ b/libc/sysdeps/linux/arm/sysdep.h
+@@ -254,5 +254,116 @@ __local_syscall_error:						\
+ #define UNDOARGS_6 ldmfd sp!, {r4, r5};
+ #define UNDOARGS_7 ldmfd sp!, {r4, r5, r6};
+ 
++#else /* not __ASSEMBLER__ */
++/* Define a macro which expands into the inline wrapper code for a system
++   call.  */
++#undef INLINE_SYSCALL
++#define INLINE_SYSCALL(name, nr, args...)					\
++  ({ unsigned int _inline_sys_result = INTERNAL_SYSCALL (name, , nr, args);	\
++     if (unlikely (INTERNAL_SYSCALL_ERROR_P (_inline_sys_result, )))	\
++       {									\
++	 __set_errno (INTERNAL_SYSCALL_ERRNO (_inline_sys_result, ));		\
++	 _inline_sys_result = (unsigned int) -1;				\
++       }									\
++     (int) _inline_sys_result; })
++
++#undef INTERNAL_SYSCALL_DECL
++#define INTERNAL_SYSCALL_DECL(err) do { } while (0)
++
++#undef INTERNAL_SYSCALL_RAW
++#if defined(__thumb__)
++/* Hide the use of r7 from the compiler, this would be a lot
++ * easier but for the fact that the syscalls can exceed 255.
++ * For the moment the LOAD_ARG_7 is sacrificed.
++ * We can't use push/pop inside the asm because that breaks
++ * unwinding (ie. thread cancellation).
++ */
++#define INTERNAL_SYSCALL_RAW(name, err, nr, args...)		\
++  ({ unsigned int _internal_sys_result;				\
++    {								\
++      int _sys_buf[2];						\
++      register int __a1 __asm__ ("a1");				\
++      register int *_v3 __asm__ ("v3") = _sys_buf;		\
++      LOAD_ARGS_##nr (args)					\
++      *_v3 = (int) (name);					\
++      __asm__ __volatile__ ("str	r7, [v3, #4]\n"		\
++                    "\tldr      r7, [v3]\n"			\
++                    "\tswi      0       @ syscall " #name "\n"	\
++                    "\tldr      r7, [v3, #4]"			\
++                   : "=r" (__a1)				\
++                    : "r" (_v3) ASM_ARGS_##nr			\
++                    : "memory");				\
++      _internal_sys_result = __a1;				\
++    }								\
++    (int) _internal_sys_result; })
++#elif defined(__ARM_EABI__)
++#define INTERNAL_SYSCALL_RAW(name, err, nr, args...)		\
++  ({unsigned int _internal_sys_result;				\
++     {								\
++       register int __a1 __asm__ ("r0"), _nr __asm__ ("r7");	\
++       LOAD_ARGS_##nr (args)					\
++       _nr = name;						\
++       __asm__ __volatile__ ("swi	0x0 @ syscall " #name	\
++		     : "=r" (__a1)				\
++		     : "r" (_nr) ASM_ARGS_##nr			\
++		     : "memory");				\
++       _internal_sys_result = __a1;				\
++     }								\
++     (int) _internal_sys_result; })
++#else /* !defined(__ARM_EABI__) */
++#define INTERNAL_SYSCALL_RAW(name, err, nr, args...)		\
++  ({ unsigned int _internal_sys_result;				\
++     {								\
++       register int __a1 __asm__ ("a1");			\
++       LOAD_ARGS_##nr (args)					\
++       __asm__ __volatile__ ("swi	%1 @ syscall " #name	\
++		     : "=r" (__a1)				\
++		     : "i" (name) ASM_ARGS_##nr			\
++		     : "memory");				\
++       _internal_sys_result = __a1;				\
++     }								\
++     (int) _internal_sys_result; })
++#endif
++
++#undef INTERNAL_SYSCALL
++#define INTERNAL_SYSCALL(name, err, nr, args...)		\
++	INTERNAL_SYSCALL_RAW(SYS_ify(name), err, nr, args)
++
++#undef INTERNAL_SYSCALL_ARM
++#define INTERNAL_SYSCALL_ARM(name, err, nr, args...)		\
++	INTERNAL_SYSCALL_RAW(__ARM_NR_##name, err, nr, args)
++
++#undef INTERNAL_SYSCALL_ERROR_P
++#define INTERNAL_SYSCALL_ERROR_P(val, err) \
++  ((unsigned int) (val) >= 0xfffff001u)
++
++#undef INTERNAL_SYSCALL_ERRNO
++#define INTERNAL_SYSCALL_ERRNO(val, err)	(-(val))
++
++#if defined(__ARM_EABI__)
++#undef INTERNAL_SYSCALL_NCS
++#define INTERNAL_SYSCALL_NCS(number, err, nr, args...)		\
++	INTERNAL_SYSCALL_RAW(number, err, nr, args)
++#else
++/* We can't implement non-constant syscalls directly since the syscall
++   number is normally encoded in the instruction.  So use SYS_syscall.  */
++#undef INTERNAL_SYSCALL_NCS
++#define INTERNAL_SYSCALL_NCS(number, err, nr, args...)		\
++	INTERNAL_SYSCALL_NCS_##nr (number, err, args)
++
++#define INTERNAL_SYSCALL_NCS_0(number, err, args...)		\
++	INTERNAL_SYSCALL (syscall, err, 1, number, args)
++#define INTERNAL_SYSCALL_NCS_1(number, err, args...)		\
++	INTERNAL_SYSCALL (syscall, err, 2, number, args)
++#define INTERNAL_SYSCALL_NCS_2(number, err, args...)		\
++	INTERNAL_SYSCALL (syscall, err, 3, number, args)
++#define INTERNAL_SYSCALL_NCS_3(number, err, args...)		\
++	INTERNAL_SYSCALL (syscall, err, 4, number, args)
++#define INTERNAL_SYSCALL_NCS_4(number, err, args...)		\
++	INTERNAL_SYSCALL (syscall, err, 5, number, args)
++#define INTERNAL_SYSCALL_NCS_5(number, err, args...)		\
++	INTERNAL_SYSCALL (syscall, err, 6, number, args)
++#endif
++
+ #endif	/* __ASSEMBLER__ */
+ #endif /* linux/arm/sysdep.h */
+-- 
+2.7.4
+
Signature · 1 line
2.7.4
#4 lore raw

cover Fix our defconfigs (branch yem/fix-defconfigs)

In reply to Yann E. MORIN

Hello,

Quoted 3 lines · Yann E. MORIN

defconfigs/kb9202: fix headers version defconfigs/snps_axs_10*: uboot needs dtc pcakage/uclibc: fix build on thumb2-only arm cpus

All three applied. If not already done, please make sure to report on the uclibc mailing list the thumb2 problem.

BTW, now that I re-read your commit log, it's wrong: the SAMA5 are not at all Thumb2 only CPUs. They are regular Cortex-A5 CPUs, i.e they support both Thumb-2 and ARM.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

cover Fix our defconfigs (branch yem/fix-defconfigs)

Thomas, All,

On 2016-08-07 22:54 +0200, Thomas Petazzoni spake thusly:

Quoted 6 lines · Yann E. MORIN
Quoted 3 lines

defconfigs/kb9202: fix headers version defconfigs/snps_axs_10*: uboot needs dtc pcakage/uclibc: fix build on thumb2-only arm cpus

All three applied. If not already done, please make sure to report on the uclibc mailing list the thumb2 problem.

Sure, I was about to do so...

Quoted 3 lines

BTW, now that I re-read your commit log, it's wrong: the SAMA5 are not at all Thumb2 only CPUs. They are regular Cortex-A5 CPUs, i.e they support both Thumb-2 and ARM.

Right, what I meant to say was that it is fixing our thumb2 defconfigs.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'