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

migrate off uclibc #82

Open
claud9999 opened this issue Feb 23, 2021 · 6 comments
Open

migrate off uclibc #82

claud9999 opened this issue Feb 23, 2021 · 6 comments

Comments

@claud9999
Copy link

Per https://en.wikipedia.org/wiki/UClibc the uclibc library hasn't been updated since 2012. Folks on the 'nets' have suggested musl but there's also uclibc-ng.

@claud9999
Copy link
Author

Looks like there's a set of binaries for MIPS at https://musl.cc ...looking promising!

@claud9999
Copy link
Author

FYI I've been able to get all of the modules to build...but v4l2rtspserver fails to link with some obscure errors. I'm going back to see if I can cross-compile the original v4l2rtspserver and then figure out what's different here.

@nik0
Copy link
Contributor

nik0 commented Feb 25, 2021

What are the errors ?

@claud9999
Copy link
Author

/raid2/Main/mipsel-linux-musl-cross/bin/../lib/gcc/mipsel-linux-musl/10.2.1/../../../../mipsel-linux-musl/bin/ld: DWARF error: could not find variable specification at offset 6d5
/raid2/Main/mipsel-linux-musl-cross/bin/../lib/gcc/mipsel-linux-musl/10.2.1/../../../../mipsel-linux-musl/bin/ld: DWARF error: could not find variable specification at offset 6e0
/raid2/Main/mipsel-linux-musl-cross/bin/../lib/gcc/mipsel-linux-musl/10.2.1/../../../../mipsel-linux-musl/bin/ld: DWARF error: could not find variable specification at offset 738
/raid2/Main/mipsel-linux-musl-cross/bin/../lib/gcc/mipsel-linux-musl/10.2.1/../../../../mipsel-linux-musl/bin/ld: DWARF error: could not find variable specification at offset 764
/raid2/Main/mipsel-linux-musl-cross/bin/../lib/gcc/mipsel-linux-musl/10.2.1/../../../../mipsel-linux-musl/bin/ld: DWARF error: could not find variable specification at offset 797
/raid2/Main/mipsel-linux-musl-cross/bin/../lib/gcc/mipsel-linux-musl/10.2.1/../../../../mipsel-linux-musl/bin/ld: DWARF error: could not find variable specification at offset 7a2
libv4l2wrapper.a(logger.o): in function `__static_initialization_and_destruction_0(int, int)':
/raid2/Main/toolchain/mips-linux-gnu/include/c++/5.2.0/iostream:74:(.text+0x38): relocation R_MIPS_HI16 against `a local symbol' cannot be used when making a shared object; recompile with -fPIC
/raid2/Main/toolchain/mips-linux-gnu/include/c++/5.2.0/iostream:74:(.text+0x40): relocation R_MIPS_26 against `_ZNSt8ios_base4InitC1Ev@@GLIBCXX_3.4' cannot be used when making a shared object; recompile with -fPIC
/raid2/Main/toolchain/mips-linux-gnu/include/c++/5.2.0/iostream:74:(.text+0x48): relocation R_MIPS_HI16 against `__dso_handle' cannot be used when making a shared object; recompile with -fPIC
/raid2/Main/toolchain/mips-linux-gnu/include/c++/5.2.0/iostream:74:(.text+0x50): relocation R_MIPS_HI16 against `a local symbol' cannot be used when making a shared object; recompile with -fPIC
/raid2/Main/toolchain/mips-linux-gnu/include/c++/5.2.0/iostream:74:(.text+0x58): relocation R_MIPS_HI16 against `_ZNSt8ios_base4InitD1Ev@@GLIBCXX_3.4' cannot be used when making a shared object; recompile with -fPIC
/raid2/Main/toolchain/mips-linux-gnu/include/c++/5.2.0/iostream:74:(.text+0x60): relocation R_MIPS_26 against `__cxa_atexit' cannot be used when making a shared object; recompile with -fPIC
libv4l2wrapper.a(logger.o): in function `_GLOBAL__sub_I_LogLevel':
/raid2/Main/v4l2rtspserver-master/v4l2wrapper/src/logger.cpp:13:(.text+0x9c): relocation R_MIPS_26 against `a local symbol' cannot be used when making a shared object; recompile with -fPIC
/raid2/Main/mipsel-linux-musl-cross/bin/../lib/gcc/mipsel-linux-musl/10.2.1/../../../../mipsel-linux-musl/bin/ld: non-dynamic relocations refer to dynamic symbol __cxa_atexit
/raid2/Main/mipsel-linux-musl-cross/bin/../lib/gcc/mipsel-linux-musl/10.2.1/../../../../mipsel-linux-musl/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/v4l2rtspserver-master.dir/build.make:326: v4l2rtspserver-master] Error 1
make[2]: Leaving directory '/raid2/Main/v4l2rtspserver-master'
make[1]: *** [CMakeFiles/Makefile2:135: CMakeFiles/v4l2rtspserver-master.dir/all] Error 2
make[1]: Leaving directory '/raid2/Main/v4l2rtspserver-master'
make: *** [Makefile:130: all] Error 2

@claud9999
Copy link
Author

FYI I was able to cross-compile the v4l2rtspserver using musl, but clearly there've been some significant modifications for the Dafang project, including the integration with the T20 firmware blobs. From what I've seen, the "DWARF" errors may be issues with class variables or mis-match with class method definitions in headers and .cpp. Anyways, I can commit what I have so far to a branch if you'd like to take a crack.

$ file v4l2rtspserver
v4l2rtspserver: ELF 32-bit LSB shared object, MIPS, MIPS-I version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-mipsel.so.1, not stripped
$ git remote -v
origin	[email protected]:mpromonet/v4l2rtspserver (fetch)
origin	[email protected]:mpromonet/v4l2rtspserver (push)

@claud9999
Copy link
Author

FYI I pushed to https://github.com/claud9999/Main/tree/musl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants