LINK is setted to riscv64-unknown-elf-gcc, but env.Program execute use ld #4588
Replies: 21 comments
-
Curious why your target arch spec looks so odd? I'd expect just
While most builds using a gcc toolcchain use the special variable It's not SCons executing |
Beta Was this translation helpful? Give feedback.
-
@zhajio1988 base questions first
|
Beta Was this translation helpful? Give feedback.
-
Can you run |
Beta Was this translation helpful? Give feedback.
-
@mwichmann The -march option is copied from T-head‘s makefile. ld command finally point to ”/opt/picocom/ThirdParty_Libs/T-head/C920_R2S0P21/C920_R2S0_manuals_and_tools/manuals_and_tools/08_toolchain_900_series_cpu_toolchain/V2.8.0/Xuantie-900-gcc-elf-newlib-x86_64-V2.8.0/bin/../lib/gcc/riscv64-unknown-elf/10.4.0/../../../../riscv64-unknown-elf/bin/ld” |
Beta Was this translation helpful? Give feedback.
-
Hi @bdbaddog
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
@bdbaddog
|
Beta Was this translation helpful? Give feedback.
-
At a first glance, the setting of
and then an error from the linker, indicating it's trying to make a program out of it, rather than an object:
I'd expect the line from building this object file from assembly to look like:
Maybe if you try that change first, we can see if there are other issues. EDITED: that is, in the SConstruct, make a change like: -AS = PREFIX + 'gcc'
+AS = PREFIX + 'as' |
Beta Was this translation helpful? Give feedback.
-
Thanks for your help. @mwichmann
|
Beta Was this translation helpful? Give feedback.
-
Try running this command manually
Is there a core_init.h header file anywhere in your tree or in your toolchain's tree? |
Beta Was this translation helpful? Give feedback.
-
Definitely making progress, a header-include problem should just require adding to the right SCons construction variable. @bdbaddog - is |
Beta Was this translation helpful? Give feedback.
-
Actually, I've been using gcc to compile .s files, and I don't have this problem with gcc. |
Beta Was this translation helpful? Give feedback.
-
I changed to scons flow from an old makefile that had the following code in it.
What you can look at is the .s file compiled with riscv64-unknown-elf-gcc |
Beta Was this translation helpful? Give feedback.
-
Try adding this at line 160 in your SConstruct That should change the crt0.s compile line to: Which I think should work.. For files named .s, .asm, .ASM SCons will run assembler without specifying preprocessor directives on the command line. The change above tells SCons to apply the preprocessing flags (defines, include paths) to the .s, .asm, .ASM suffixed files. Note if you're on a case-insensitve filesystem remove the .S file from the list which would be preprocessed. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
@zhajio1988 - Please skip including the whole build log, and just include the failed command and it's errors/warnings.. much easier to read.. Also now your issue is no longer SCons related I think. |
Beta Was this translation helpful? Give feedback.
-
@bdbaddog |
Beta Was this translation helpful? Give feedback.
-
I'm going to close this issue as it was really about your usage of SCons and not a defect with SCons itself. In the future it's preferred to bring such issues to our mailing list or our discord server, and not file a bug until the maintainers have determined it's not a user issue. You can find how to get to the mailing list or discord server here: https://scons.org/contact.html |
Beta Was this translation helpful? Give feedback.
-
@bdbaddog |
Beta Was this translation helpful? Give feedback.
-
@zhajio1988 glad @mwichmann and I could help. |
Beta Was this translation helpful? Give feedback.
-
I'll move it over to Conversations (will have the same number but won't be listed in issues) |
Beta Was this translation helpful? Give feedback.
-
LINK is setted to riscv64-unknown-elf-gcc, but env.Program execute use ld.
I use env.Dump()get below outputs:
'LINK': 'riscv64-unknown-elf-gcc', 'LINKCOM': '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS ' '$_LIBFLAGS', 'LINKFLAGS': ' ' '-march=rv64imafdcv_zicbom_zicbop_zicboz_zicond1p0_zihintntl0p2_zihintpause_zawrs_zfa0p1_zfbfmin0p8_zfh_zca_zcb_zcd_zba_zbb_zbc_zbs_zvfbfmin0p8_zvfbfwma0p8_svinval_svpbmt_xtheadc_xtheadvdot ' '-mabi=lp64d -mtune=c920 -nostartfiles -lc -lgcc -lm -T ' '/ssd_fes/jiongz/desktop/github/diff_ip_vv/pc801_c920_ip_vv/smart_run/tests/lib/init/linker.lcf ' '-L ' '/ssd_fes/jiongz/desktop/github/diff_ip_vv/pc801_c920_ip_vv/smart_run/tests/lib/init',
Could anyone help me about this issue?
Beta Was this translation helpful? Give feedback.
All reactions