-
-
Notifications
You must be signed in to change notification settings - Fork 319
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
LINK is setted to riscv64-unknown-elf-gcc, but env.Program execute use ld #4587
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 |
@zhajio1988 base questions first
|
Can you run |
@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” |
Hi @bdbaddog
|
|
@bdbaddog
|
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' |
Thanks for your help. @mwichmann
|
Try running this command manually
Is there a core_init.h header file anywhere in your tree or in your toolchain's tree? |
Definitely making progress, a header-include problem should just require adding to the right SCons construction variable. @bdbaddog - is |
Actually, I've been using gcc to compile .s files, and I don't have this problem with gcc. |
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 |
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. |
|
@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. |
@bdbaddog |
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 |
@bdbaddog |
@zhajio1988 glad @mwichmann and I could help. |
I'll move it over to Conversations (will have the same number but won't be listed in issues) |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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?
The text was updated successfully, but these errors were encountered: