-
Notifications
You must be signed in to change notification settings - Fork 18
arm: adapt to being built as multilib #409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Unit Test Results7 958 tests 7 434 ✅ 40m 41s ⏱️ Results for commit 920a997. ♻️ This comment has been updated with latest results. |
arch/arm/Makefile
Outdated
@@ -14,9 +14,19 @@ else ifneq (,$(findstring v8m,$(TARGET_SUFF))) | |||
include arch/arm/v8m/Makefile | |||
else ifneq (,$(findstring v8r,$(TARGET_SUFF))) | |||
include arch/arm/v8r/Makefile | |||
else ifneq (,$(findstring v8r,$(TARGET_SUFF))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replicated from lines 15-16
arch/arm/Makefile
Outdated
else ifneq (,$(findstring v8r,$(TARGET_SUFF))) | ||
include arch/arm/v8r/Makefile | ||
else ifeq ($(TARGET_SUBFAMILY),multilib) | ||
# TODO: Try to include correct Makefile if possible in case of a multilib. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little bit afraid that we will build non-fuctioning subvariants for supported targets while building the toolchain - eg. which implementation of setjmp
will be used for armv7m7-imx117x
with FDPIC enabled? (it's not a standard phoenix target, so it will be built only by multilib option?
Maybe we should try to inspect CFLAGS (march/mcpu
options)? Or try using output of $(CC) $(CFALGS) -print-multi-directory
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be the go to solution, however, I don't think I have time to fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, however, that when we create such a configuration and build simply libphoenix during building the target then correct implementation will be used, as install is make target is called
char *strncpy(char *dest, const char *src, size_t n) | ||
{ | ||
size_t i = 0; | ||
while (((i < n) && (src[i] != '\0'))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not a valid implementation of strncpy
(zero-fill all of the remaining place, don't add `'\0' if it doesn't fit)
} | ||
|
||
|
||
int strncmp(const char *s1, const char *s2, size_t count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid - strncmp("a", "ab", 2)
returns 0 (should return negative value)
} | ||
|
||
|
||
int strcmp(const char *s1, const char *s2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid - strcmp("a", "ab")
returns 0 (should return negative value)
arch/arm/multilib/string.c
Outdated
{ | ||
size_t i = 0; | ||
while ((src[i] != '\0')) { | ||
((char *)dest)[i] = ((const char *)src)[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need explicit casts here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copied from memcpy
317e341
to
7d4d2a9
Compare
7d4d2a9
to
26fe01e
Compare
.globl sym; \ | ||
.type sym, %function; \ | ||
sym: \ | ||
bl abort; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bl
as b
may have to short range
.globl _signal_trampoline | ||
.type _signal_trampoline, %function | ||
_signal_trampoline: | ||
bl abort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bl
as b
may have to short range
JIRA: RTOS-1028
26fe01e
to
920a997
Compare
JIRA: RTOS-1028
Description
Multilib support is very basic and the multilibs are virtually useless as the syscalls are not implemented. To add proper support the ASM code should be chosen for each version based on GCC flags not target.
Motivation and Context
Types of changes
How Has This Been Tested?
Checklist:
Special treatment