Hello there!
This is a really simple one but I haven't been able to find it yet. Since there are various configurations in the tasks/ folder, I would like to know if it would be possible to make one, in which a kernel image is not built?
Reason being that I am trying to construct a rootfs for a Docker container. So, a kernel is not needed - just the headers.
Is that possible?
Kind regards,
Ingwie
Hi Kevin,
this might be better posted to the OpenADK mailinglist.
> Hello there!
>
> Apologies if this is going into the wrong list, but I honestly was n't sure,e specially since this very issue was discussed a long time ago - found an exchange about this in the archive through Google - so I ended up just posting it here.
>
> I am currently building a toolset for RISC-V to use as a rootfs for a Docker Container that can then be used as a Jenkins agent to eventually build my way through Alpine's abuild/aports, so that I can reconstruct the alpine:3.19 image, but for RISC-V (there are only snapshots and the :edge image, right now).
>
> Most things built just fine; kernel, toolchain and alike. But when it tries to configure libatomic for the target, this happens:
>
> configure:14906: riscv64-openadk-linux-uclibc-cc -o conftest -g -O2 -g -Os -fno-sync-libcalls -pthread conftest.c >&5/nvme/opt/openadk/toolchain_generic-riscv64_uclibc-ng/usr/lib/gcc/riscv64-openadk-linux-uclibc/13.2.0/../../../../riscv64-openadk-linux-uclibc/bin/ld: /nvme/opt/openadk/toolchain_generic-riscv64_uclibc-ng/usr/lib/gcc/riscv64-openadk-linux-uclibc/13.2.0/libgcc.a(unwind-dw2-fde-dip.o): in function `_Unwind_Find_FDE':
> (.text+0x1adc): undefined reference to `dl_iterate_phdr'
> configure:14925: error: Pthreads are required to build libatomic
>
> I went and looked up what that function is, exactly, and learned quickly that this is caused by me having chosen a static build. That said, this was also already discussed: https://uclibc.uclibc.narkive.com/079V4ltx/dl-iterate-phdr-missing-in-libc
>
> So, I am at a loss on what to do right now. I changed my setting to also build dynamic objects, then cleaned uClibc-ng and rebuilt and then attempted again to let the normal build run. But, that too, did not help.
>
> My questions:
>
> - Is dl_iterate_phdr in libc.a? According to grep, it matches, but that doesn-ät mean much.
> - I am using the 1.0.46 version of uClibc as openADK selects that.
> - Is there anything I can do to fix this, or do I have to start over and just build with shared libraries? I honestly would not be surprised if GCC just didn#t want to be statically linked; static is the devil, after all. ;)
>
Do you have a OpenADK .config to check? But I think you might be right that
you should build gcc with shared libraries supported.
best regards
Waldemar
The goal of this change is to fix FDPIC toolchain compilation.
Previous implementation had the issue that `make oldconfig`
destroyed the effect of `echo` and `sed` executing to write
BINFMT-related lines into .config.
Note that we have to use `echo UCLIBC_FORMAT_*=y` instead of sed
because in the original file `UCLIBC_FORMAT_*` line may not exist.
Sed just replaces text in lines, so if the line doesn't exist sed will do
nothing.
To have the proper `UCLIBC_FORMAT_*=y` in the .config I've changed
some `sed`s to `echo`s.
Without this change the compilation of FDPIC toolchain fails
because UCLIBC_FORMAT_FDPIC_ELF is not defined, it leads to miss
of `-mfdpic` compilation flag and to the absense of crtreloc.o object
that needs during utilities linking and the linking process fails.
Signed-off-by: Dmitry Chestnykh <dm.chestnykh(a)gmail.com>
---
toolchain/uclibc-ng/Makefile | 71 ++++++++++++++++++------------------
1 file changed, 35 insertions(+), 36 deletions(-)
diff --git a/toolchain/uclibc-ng/Makefile b/toolchain/uclibc-ng/Makefile
index 6b1fd31ce..cabac310d 100644
--- a/toolchain/uclibc-ng/Makefile
+++ b/toolchain/uclibc-ng/Makefile
@@ -85,42 +85,6 @@ ifeq ($(ADK_TARGET_HARD_FLOAT_DP),y)
$(SED) 's/.*\(UCLIBC_HAS_FPU\).*/\1=y/' ${WRKBUILD}/.config
$(SED) 's/.*\(UCLIBC_HAS_SOFT_FLOAT\).*/# \1 is not set/' ${WRKBUILD}/.config
endif
-ifeq ($(ADK_TARGET_BINFMT_ELF),y)
- $(SED) 's/.*\(UCLIBC_FORMAT_ELF\).*/\1=y/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/# \1 is not set/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_SHARED_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
-endif
-ifeq ($(ADK_TARGET_BINFMT_FDPIC),y)
- $(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/\1=y/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/# \1 is not set/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_SHARED_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
-endif
-ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
- echo '# UCLIBC_FORMAT_FLAT is not set' >> ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_FLAT\).*/\1=y/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/# \1 is not set/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_SHARED_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
-ifeq ($(ADK_TARGET_BINFMT_FLAT_SEP_DATA),y)
- echo '# UCLIBC_FORMAT_FLAT_SEP_DATA is not set' >> ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/\1=y/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_FLAT \).*/# \1 is not set/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_SHARED_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
-endif
-ifeq ($(ADK_TARGET_BINFMT_FLAT_SHARED),y)
- echo '# UCLIBC_FORMAT_SHARED_FLAT is not set' >> ${WRKBUILD}/.config
- echo '# HAVE_NO_SHARED is not set' >> ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_SHARED_FLAT\).*/\1=y/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_FLAT \).*/# \1 is not set/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/# \1 is not set/' ${WRKBUILD}/.config
- $(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
-endif
-endif
ifeq ($(ADK_TARGET_LIBC_WITH_LIBICONV),y)
$(SED) 's/.*\(UCLIBC_HAS_LIBICONV\).*/\1=y/' ${WRKBUILD}/.config
endif
@@ -344,6 +308,41 @@ endif
UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
oldconfig
+
+ifeq ($(ADK_TARGET_BINFMT_ELF),y)
+ echo 'UCLIBC_FORMAT_ELF=y' >> ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_SHARED_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
+endif
+ifeq ($(ADK_TARGET_BINFMT_FDPIC),y)
+ echo 'UCLIBC_FORMAT_FDPIC_ELF=y' >> ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_SHARED_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
+endif
+ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
+ echo 'UCLIBC_FORMAT_FLAT=y' >> ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_SHARED_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
+ifeq ($(ADK_TARGET_BINFMT_FLAT_SEP_DATA),y)
+ echo 'UCLIBC_FORMAT_FLAT_SEP_DATA=y' >> ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_FLAT \).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_SHARED_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
+endif
+ifeq ($(ADK_TARGET_BINFMT_FLAT_SHARED),y)
+ echo '# HAVE_NO_SHARED is not set' >> ${WRKBUILD}/.config
+ echo 'UCLIBC_FORMAT_SHARED_FLAT=y' >> ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_FLAT \).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/# \1 is not set/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
+endif
+endif
+
ifeq ($(ADK_TARGET_LIBC_WITH_LOCALE),y)
$(SED) 's/.*\(UCLIBC_BUILD_MINIMAL_LOCALES\).*/\1="$(ADK_RUNTIME_DEFAULT_LOCALE)"/' ${WRKBUILD}/.config
endif
--
2.43.0
Good afternoon (o;
Seems this mailing list is rather empty..but hoping some users are
still around
as at least the git repo keeps getting updates (o;
I used in the past the uclinux build system, and looking now
for some alternative to build firmware files for MIPS and ARM systems...
Also used openwork for certain MIPS board as it was the only way
to build firmware for those AR9331 SoCs....but openwrt is a nightmare
to modify it to your needs ;-)
So here a simple to get started with opened:
As a start I want to use the Dragon ms14-s board as it seems to be
close to the Carambola2 board...
From openwrt I know that the carambola needs kernel binary file and
a squashfs...but this is not available as a target firmware file...
So how would I proceed for a first test to flash a Carambola2 board
with an opened generated firmware so it will be accepted by their
u-boot loader?
I assume with a custom post hook script?
Haven't found any resources on the web how people use opened on an
actual hardware from start to the flashing procedure....
thanks in advance
richard