Skip to contentSkip to conversation

arm64: LLVMLinux: Provide __aeabi_* symbols which are needed for clang

PATCH In review [email protected] 4 participants 7 messages Sep 5, 2014 – Sep 8, 2014 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: LLVMLinux: Provide __aeabi_* symbols which are needed for clang

From: Behan Webster <[email protected]>

These symbols are required when compiling the Linux kernel for arch ARM64 with clang.

Author: Mark Charlebois <[email protected]>

---
 arch/arm64/lib/Makefile |  4 ++++
 arch/arm64/lib/eabi.c   | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 arch/arm64/lib/eabi.c
arch/arm64/lib/Makefile +4 -0
index d98d3e3..0d3407c 100644
@@ -3,3 +3,7 @@ lib-y		:= bitops.o clear_user.o delay.o copy_from_user.o	\
 		   clear_page.o memchr.o memcpy.o memmove.o memset.o	\
 		   memcmp.o strcmp.o strncmp.o strlen.o strnlen.o	\
 		   strchr.o strrchr.o
+
+ifeq ($(COMPILER),clang)
+lib-y += eabi.o
+endif
arch/arm64/lib/eabi.c new file +32 -0
new file mode 100644
index 0000000..41b27b2
@@ -0,0 +1,32 @@
+/*
+ *  linux/lib/eabi.c
+ *
+ *  Copyright (C) 2012  Mark Charlebois
+ */
+
+/*
+ * EABI routines
+ */
+
+#include <linux/types.h>
+#include <linux/string.h>
+#include <linux/ctype.h>
+#include <linux/export.h>
+
+void __aeabi_memcpy(void *dest, const void *src, size_t n)
+{
+	(void)memcpy(dest, src, n);
+}
+EXPORT_SYMBOL(__aeabi_memcpy);
+
+void __aeabi_memmove(void *dest, const void *src, size_t n)
+{
+	(void)memmove(dest, src, n);
+}
+EXPORT_SYMBOL(__aeabi_memmove);
+
+void __aeabi_memset(void *s, size_t n, int c)
+{
+	(void)memset(s, c, n);
+}
+EXPORT_SYMBOL(__aeabi_memset);
Signature · 1 line
1.9.1
#1 lore raw

arch/arm64/lib/eabi.c line 2

Quoted 5 lines · On Friday 05 September 2014 16:23:14 behanw at converseincode.com wrote:
arch/arm64/lib/eabi.c new file +2 -0
@@ -0,0 +1,32 @@
+/*
+ *  linux/lib/eabi.c

Please don't put the file names in the files themselves, it's redundant and in this case actually wrong.

arch/arm64/lib/eabi.c line 8

Quoted 5 lines
arch/arm64/lib/eabi.c new file +5 -0
+ *  Copyright (C) 2012  Mark Charlebois
+ */
+
+/*
+ * EABI routines

Does EABI specify these function names? I would think that they are just random libgcc (whatever that is called in clang) functions.

Arnd

#2 lore raw
Quoted 8 lines · Arnd Bergmann

arch/arm64/lib/eabi.c line 2

Quoted 5 lines · On Friday 05 September 2014 16:23:14 behanw at converseincode.com wrote:
arch/arm64/lib/eabi.c new file +2 -0
@@ -0,0 +1,32 @@
+/*
+ *  linux/lib/eabi.c

Please don't put the file names in the files themselves, it's redundant and in this case actually wrong.

Will fix.

Quoted 7 lines

arch/arm64/lib/eabi.c line 8

Quoted 5 lines
arch/arm64/lib/eabi.c new file +5 -0
+ *  Copyright (C) 2012  Mark Charlebois
+ */
+
+/*
+ * EABI routines

Does EABI specify these function names? I would think that they are just random libgcc (whatever that is called in clang) functions.

These specialized functions are part of the ABI for the ARM architecture (AEABI). They aren't random.

Memcpy and memmove *could* might be satisfied with linker magic instead. But memset uses the reverse parameter list.

Behan

Signature · 2 lines
Behan Webster
behanw at converseincode.com
#3 lore raw
In reply to Arnd Bergmann
Quoted 10 lines · Arnd Bergmann

arch/arm64/lib/eabi.c line 2

Quoted 5 lines · On Friday 05 September 2014 16:23:14 behanw at converseincode.com wrote:
arch/arm64/lib/eabi.c new file +2 -0
@@ -0,0 +1,32 @@
+/*
+ *  linux/lib/eabi.c

Please don't put the file names in the files themselves, it's redundant and in this case actually wrong.

Sorry, will fix.

Quoted 9 lines

arch/arm64/lib/eabi.c line 8

Quoted 6 lines
arch/arm64/lib/eabi.c new file +5 -0
+ *  Copyright (C) 2012  Mark Charlebois
+ */
+
+/*
+ * EABI routines

Does EABI specify these function names? I would think that they are just random libgcc (whatever that is called in clang) functions.

http://infocenter.arm.com/help/topic/com.arm.doc.ihi0043d/IHI0043D_rtabi.pdf

See section 4.3.4 Memory copying, clearing, and setting

Quoted 2 lines

Arnd

maintainer
#4 lore raw
Quoted 12 lines · Mark Charlebois
Quoted 10 lines · Arnd Bergmann

arch/arm64/lib/eabi.c line 8

Quoted 5 lines · On Friday 05 September 2014 16:23:14 behanw at converseincode.com wrote:

+ * Copyright (C) 2012 Mark Charlebois
+ */

arch/arm64/lib/eabi.c new file +3 -0
+
+/*
+ * EABI routines

Does EABI specify these function names? I would think that they are just random libgcc (whatever that is called in clang) functions.

Quoted 3 lines

http://infocenter.arm.com/help/topic/com.arm.doc.ihi0043d/IHI0043D_rtabi.pdf

See section 4.3.4 Memory copying, clearing, and setting

What does this document have to do with arm64 (AArch64, A64)? We don?t need such symbols on arm64. Also, the arm64 kernel links with libgcc (no immediate need AFAICT but the compiler does not guarantee the intrinsics would always be generated inline).

Catalin

#5 lore raw
Quoted 13 lines · Catalin Marinas
Quoted 12 lines · Mark Charlebois
Quoted 10 lines · Arnd Bergmann

arch/arm64/lib/eabi.c line 8

Quoted 5 lines · On Friday 05 September 2014 16:23:14 behanw at converseincode.com wrote:

+ * Copyright (C) 2012 Mark Charlebois
+ */

arch/arm64/lib/eabi.c new file +3 -0
+
+/*
+ * EABI routines

Does EABI specify these function names? I would think that they are just random libgcc (whatever that is called in clang) functions.

Quoted 8 lines
Quoted 3 lines

http://infocenter.arm.com/help/topic/com.arm.doc.ihi0043d/IHI0043D_rtabi.pdf

See section 4.3.4 Memory copying, clearing, and setting

What does this document have to do with arm64 (AArch64, A64)? We don?t need such symbols on arm64. Also, the arm64 kernel links with libgcc (no immediate need AFAICT but the compiler does not guarantee the intrinsics would always be generated inline).

[reposting in plain text]

This patch was made early in the arm64 kernel support. I just retested and you are correct, it is no longer needed. My apologies to all.

-Mark

Quoted 2 lines

Catalin

#6 lore raw
Quoted 15 lines · Mark Charlebois
Quoted 13 lines · Catalin Marinas
Quoted 12 lines · Mark Charlebois
Quoted 8 lines · Arnd Bergmann

arch/arm64/lib/eabi.c line 8

Quoted 5 lines · On Friday 05 September 2014 16:23:14 behanw at converseincode.com wrote:

+ * Copyright (C) 2012 Mark Charlebois
+ */

arch/arm64/lib/eabi.c new file +3 -0
+
+/*
+ * EABI routines

Does EABI specify these function names? I would think that they are just random libgcc (whatever that is called in clang) functions.

http://infocenter.arm.com/help/topic/com.arm.doc.ihi0043d/IHI0043D_rtabi.pdf

See section 4.3.4 Memory copying, clearing, and setting

Quoted 8 lines
Quoted 4 lines

What does this document have to do with arm64 (AArch64, A64)? We don?t need such symbols on arm64. Also, the arm64 kernel links with libgcc (no immediate need AFAICT but the compiler does not guarantee the intrinsics would always be generated inline).

[reposting in plain text]

This patch was made early in the arm64 kernel support. I just retested and you are correct, it is no longer needed. My apologies to all.

Whoops. I normally check whether a patch is still needed before posting them. I seem to have missed that step this time. My apologies as well.

That all being said, I prefer to see patches no longer required, than needing them to be upstreamed, so in that this is a win.

Behan

Signature · 2 lines
Behan Webster
behanw at converseincode.com