-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix greenhills compile and link error on NuttX #12846
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
Conversation
…zl error [elxr] (error apache#412) unresolved symbols: 1 __builtin_clzl from libc.a(lib_flsl.o) Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
[elxr] (error apache#412) unresolved symbols: __builtin_signbit from libc.a(lib_dtoa_engine.o) Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
common/gnu/fork.S 29: unknown instruction .syntax unified --^ [asarm] (error apache#2230) common/gnu/fork.S 81: bad directive .type up_fork , function ------------------^ [asarm] (error apache#2067) armv7-m/arm_saveusercontext.S 31: unknown instruction .syntax unified --^ [asarm] (error apache#2230) armv7-m/arm_saveusercontext.S 55: bad directive .type up_saveusercontext , % function --^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 65: not within valid register range str r12 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 4 ) ) ] ------^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 66: not within valid register range str r14 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 5 ) ) ] ------^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 67: not within valid register range str r14 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 6 ) ) ] ------^ [asarm] (error apache#2014) armv7-m/arm_saveusercontext.S 72: expected a register str r1 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 7 ) ) ] ------------------^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 75: not within valid register range add r1 , r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 8 ) ) -----------^ [asarm] (error apache#2071) armv7-m/arm_saveusercontext.S 89: bad parameter stmia r0 ! , { r2 - r11 } --------^ [asarm] (error apache#2014) armv7-m/arm_saveusercontext.S 93: expected a register mov r1 , - 1 -----------^ Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
[elxr] (error apache#412) unresolved symbols: __gh_long_long_printf from libc.a(lib_libbsprintf.o) __gh_float_printf from libc.a(lib_libbsprintf.o) Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
|
|
||
| /* Built-ins */ | ||
| # if __GNUC__ >= 4 | ||
| # if __GNUC__ >= 4 && !defined(__ghs__) |
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.
check ghs before GNUC
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.
check ghs before GNUC
this is invalid, cause we are using compatible GNUC mode, there are still some features that is needed for GNUC,
if we remove this check, error will happen
|
|
||
| /* Green Hills Software definitions *****************************************/ | ||
|
|
||
| #if defined(__ghs__) |
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.
move to line 103
| #if defined(__ghs__) | ||
|
|
||
| # pragma weak __gh_long_long_printf | ||
| # pragma weak __gh_float_printf |
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.
add some comments for this hack
|
|
||
| .globl up_fork | ||
| #ifdef __ghs__ | ||
| .type up_fork, $function |
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.
| .type up_fork, $function | |
| .type up_fork, "function" |
Use double quotes, remove the check
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.
Use double quotes, remove the check
but this will produce the following error:
CC: sched/sched_waitpid.c [asarm] (error #2230) common/gnu/fork.S 80: bad directive
.type up_fork , "function"
--^
| * Pre-processor Prototypes | ||
| ****************************************************************************/ | ||
|
|
||
| #define up_getsp() (uintptr_t)__builtin_frame_address(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.
I think this was added specially for tlsr82. @anchao @xiaoxiang781216 please confirm.
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.
tls82 is fixed in the next.
| uint8_t flags = 0; | ||
| int i; | ||
|
|
||
| if (__builtin_signbit(x)) |
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 think this was a part of a bugfix recently (not sure if bugfix was correct on usage GNU built-in). I will search for PR
[elxr] (error apache#412) unresolved symbols: __builtin_frame_address from libarch.a(arm_checkstack.o) Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
/mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: warning: /mnt/yang/qixinwei_qemu/nuttx/nuttx has a LOAD segment with RWX permissions /mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/lib/thumb/v7ve+simd/hard/libg.a(libc_a-stack_protector.o): in function `__stack_chk_fail': stack_protector.c:(.text.__stack_chk_fail+0x2c): undefined reference to `strlen' /mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: stack_protector.c:(.text.__stack_chk_fail+0x36): undefined reference to `write' /mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: stack_protector.c:(.text.__stack_chk_fail+0x42): undefined reference to `_exit' /mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/lib/thumb/v7ve+simd/hard/libg.a(libc_a-signalr.o): in function `_kill_r': signalr.c:(.text._kill_r+0x18): undefined reference to `_kill' /mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/lib/thumb/v7ve+simd/hard/libg.a(libc_a-signalr.o): in function `_getpid_r': signalr.c:(.text._getpid_r+0x0): undefined reference to `_getpid' /mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/thumb/v7ve+simd/hard/libgcc.a(unwind-arm.o): in function `unwind_phase2': unwind-arm.c:(.text.unwind_phase2+0x36): undefined reference to `abort' /mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/thumb/v7ve+simd/hard/libgcc.a(unwind-arm.o): in function `unwind_phase2_forced': unwind-arm.c:(.text.unwind_phase2_forced+0x4c): undefined reference to `memcpy' /mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: unwind-arm.c:(.text.unwind_phase2_forced+0x7a): undefined reference to `memcpy' /mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/thumb/v7ve+simd/hard/libgcc.a(unwind-arm.o): in function `__gnu_Unwind_Resume': unwind-arm.c:(.text.__gnu_Unwind_Resume+0x3c): undefined reference to `abort' /mnt/yang/qixinwei_qemu/prebuilts/gcc/linux/arm/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: unwind-arm.c:(.text.__gnu_Unwind_Resume+0x40): undefined reference to `abort' collect2: error: ld returned 1 exit status Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
"stdio/lib_dtoa_engine.c", line 102: error apache#166: invalid floating constant if (x < MIN_MANT) ^ "stdio/lib_dtoa_engine.c", line 102: warning apache#1626-D: concatenation with "(" in macro "PASTE" does not create a valid token if (x < MIN_MANT) ^ "stdio/lib_dtoa_engine.c", line 102: error apache#109: expression preceding parentheses of apparent call must have (pointer-to-) function type if (x < MIN_MANT) ^ "stdio/lib_dtoa_engine.c", line 107: error apache#166: invalid floating constant if (y < MAX_MANT) ^ "stdio/lib_dtoa_engine.c", line 107: warning apache#1626-D: concatenation with "(" in macro "PASTE" does not create a valid token if (y < MAX_MANT) ^ "stdio/lib_dtoa_engine.c", line 107: error apache#109: expression preceding parentheses of apparent call must have (pointer-to-) function type if (y < MAX_MANT) ^ "stdio/lib_dtoa_engine.c", line 119: error apache#166: invalid floating constant if (y >= MIN_MANT) ^ "stdio/lib_dtoa_engine.c", line 119: warning apache#1626-D: concatenation with "(" in macro "PASTE" does not create a valid token if (y >= MIN_MANT) ^ "stdio/lib_dtoa_engine.c", line 119: error apache#109: expression preceding parentheses of apparent call must have (pointer-to-) function type if (y >= MIN_MANT) ^ "stdio/lib_dtoa_engine.c", line 144: error apache#166: invalid floating constant if (x >= MAX_MANT) ^ "stdio/lib_dtoa_engine.c", line 144: warning apache#1626-D: concatenation with "(" in macro "PASTE" does not create a valid token if (x >= MAX_MANT) ^ "stdio/lib_dtoa_engine.c", line 144: error apache#109: expression preceding parentheses of apparent call must have (pointer-to-) function type if (x >= MAX_MANT) ^ "stdio/lib_dtoa_engine.c", line 153: error apache#166: invalid floating constant uint64_t decimal = MIN_MANT_INT; ^ "stdio/lib_dtoa_engine.c", line 153: warning apache#1626-D: concatenation with "(" in macro "PASTE" does not create a valid token uint64_t decimal = MIN_MANT_INT; ^ "stdio/lib_dtoa_engine.c", line 153: error apache#109: expression preceding parentheses of apparent call must have (pointer-to-) function type uint64_t decimal = MIN_MANT_INT; Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
|
@extinguish Please split the related changes in this PR into several PRs for submission. This will make it easier for everyone to review and boost the merging process.
and please merge all commits which basic support of GHS toolchain into one commit. |
Summary
fix greenhills compile and link error on NuttX
Impact
Testing