Skip to content
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

[WIP][RFC] New package: cross-riscv64-none-elf #48614

Closed
wants to merge 1 commit into from

Conversation

mikarpenko
Copy link

I am trying to package cross toolchain for bare metal risc-v targets and have some difficulties with building GCC. The build fails with a lot of errors while building libgcc:

/builddir/cross-riscv64-none-elf-gcc-13.2.0/build/./gcc/xgcc -B/builddir/cross-riscv64-none-elf-gcc-13.2.0/build/./gcc/ -B/usr/riscv64-none-elf/bin/ -B/usr/riscv64-none-elf/l
ib/ -isystem /usr/riscv64-none-elf/include -isystem /usr/riscv64-none-elf/sys-include    -g -Os -mcmodel=medany -ffunction-sections -fdata-sections -march=rv32i -mabi=ilp32 -
O2  -g -Os -mcmodel=medany -ffunction-sections -fdata-sections -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes 
-Wmissing-prototypes -Wold-style-definition  -isystem ./include   -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -I. -I. -I../../../.././gcc -I../../.
./../../libgcc -I../../../../../libgcc/. -I../../../../../libgcc/../gcc -I../../../../../libgcc/../include  -DHAVE_CC_TLS   -o _gcov_interval_profiler.o -MT _gcov_interval_pr
ofiler.o -MD -MP -MF _gcov_interval_profiler.dep -DL_gcov_interval_profiler -c ../../../../../libgcc/libgcov-profiler.c                                                       
In file included from ../../../../../libgcc/libgcov-merge.c:26:                                                                                                               
../../../../../libgcc/libgcov.h:49:10: fatal error: sys/mman.h: No such file or directory                                                                                     
   49 | #include <sys/mman.h>                                                                                                                                                 
      |          ^~~~~~~~~~~~                                                                                                                                                 
compilation terminated.                                                                                                                                                       
make[4]: *** [Makefile:924: _gcov_merge_add.o] Error 1

And the file is actually there:

find . -name mman.h
./masterdir-x86_64/usr/include/bits/mman.h
./masterdir-x86_64/usr/include/asm/mman.h
./masterdir-x86_64/usr/include/sys/mman.h
./masterdir-x86_64/usr/include/asm-generic/mman.h
./masterdir-x86_64/usr/include/linux/mman.h
./masterdir-x86_64/builddir/cross-riscv64-none-elf-gcc-13.2.0/fixincludes/tests/base/sys/mman.h

There is a workaround with patching libgconv.h and disabling HAVE_SYS_MMAN_H or using --disable-gcov configuration flag, but I don't think this is the right way to go.

At the same time I could successfully manually build it from sources on host system with almost the same set of configuration flags except for those pointing to different system directories. It looks like I am missing one step to build the package, and I would appreciate any help. I can attach full configuration and build logs if it will be helpful.

@classabbyamp classabbyamp added the new-package This PR adds a new package label Feb 9, 2024
@mikarpenko
Copy link
Author

I am closing this until a better option to build the tool chain will be found.

@mikarpenko mikarpenko closed this Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-package This PR adds a new package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants