dslm4515 / optimux Goto Github PK
View Code? Open in Web Editor NEWOptimized Musl Linux From Scratch
Optimized Musl Linux From Scratch
I was following along the scripts in doc/3-chroot/023-GCC and I stumbled upon the last command which is grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
. Suprisingly, it yielded no output at all. Is it safe to be ignored or have I missed some important steps?
Here is a copy of the stdin and stdout:
[Requesting program interpreter: /lib/ld-musl-x86_64.so.1]
(Optimux chroot) root:/sources/gcc-11.2.0/build#
(Optimux chroot) root:/sources/gcc-11.2.0/build# grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
(Optimux chroot) root:/sources/gcc-11.2.0/build#
(Optimux chroot) root:/sources/gcc-11.2.0/build# echo 'int main(){}' > dummy.c
(Optimux chroot) root:/sources/gcc-11.2.0/build# cc dummy.c -v -Wl,--verbose &> dummy.log
(Optimux chroot) root:/sources/gcc-11.2.0/build# readelf -l a.out | grep ': /lib'
[Requesting program interpreter: /lib/ld-musl-x86_64.so.1]
(Optimux chroot) root:/sources/gcc-11.2.0/build# grep 'crt[1in].o succeeded' dummy.log
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-pc-linux-musl/11.2.0/../../../../lib/Scrt1.o succeeded
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-pc-linux-musl/11.2.0/../../../../lib/crti.o succeeded
/usr/bin/ld: Attempt to open /usr/lib/gcc/x86_64-pc-linux-musl/11.2.0/../../../../lib/crtn.o succeeded
(Optimux chroot) root:/sources/gcc-11.2.0/build# grep -B2 '^ /usr/lib/gcc' dummy.log
/usr/local/include
/usr/include
/usr/lib/gcc/x86_64-pc-linux-musl/11.2.0/include
(Optimux chroot) root:/sources/gcc-11.2.0/build# grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
(Optimux chroot) root:/sources/gcc-11.2.0/build#
Expected output:
grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
SEARCH_DIR("/usr/$ARCH-pc-linux-musl/lib64")
SEARCH_DIR("/usr/local/lib64")
SEARCH_DIR("/lib64")
SEARCH_DIR("/usr/lib64")
SEARCH_DIR("/usr/x86_64-pc-linux-musl/lib")
SEARCH_DIR("/usr/local/lib")
SEARCH_DIR("/lib")
SEARCH_DIR("/usr/lib");
When configuring Texinfo. ncurses not found:
checking for tgetent in -ltinfo... no
checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for tgetent in -ltermlib... no
checking for tgetent in -ltermcap... no
checking for tgetent in -lterminfo... no
configure: WARNING: info needs a terminal library, one of: tinfo ncurses curses termlib termcap terminfo
Checking config.log:
configure:28014: checking for tgetent in -lncurses
configure:28037: x86_64-optimux-linux-musl-gcc -o conftest -g -O2 conftest.c -lncurses >&5
/mnt/optimux/cross-tools/bin/../lib/gcc/x86_64-optimux-linux-musl/11.2.0/../../../../x86_64-optimux-linux-musl/bin/ld: cannot find -lncurses
collect2: error: ld returned 1 exit status
When compiling python during chroot, ssl module is not built.
Either stick with python-3.9.7 or develop a patch to restore LibreSSL support in Python 3.10.0
After building GCC for Tools with march & mtune flags and LTO, GCC builds but cannot compile:
$ echo 'int main(){}' > dummy.c && gcc dummy.c
collect2: fatal error: ld terminated with signal 4 [Illegal instruction]
compilation terminated.
and kernel.log on the host shows:
traps: ld[10437] trap invalid opcode ip:7f75712efac8 sp:7ffd05bacc90 error:0 in libc.so[7f757128d000+76000]
For context, host is ivybridge (i5-3750) and i'm building Optimux for a Chromebook (Samsung Chromebook 3 -- celes board with Intel Atom x5 E800, silvermont architecture). Im not sure if ld built only runs on silvermont and not on ivybridge... I assume Ivybridge should be able to run code tailored for Silvermont CPU's
If I set CFLAGS & CXXFLAGS:
export CFLAGS="-march=native -pipe -fno-semantic-interposition "
export CFLAGS+="-falign-functions=32 -flimit-function-alignment -malign-data=cacheline "
export CFLAGS+="-fzero-call-used-regs=used"
export CFLAGS="-march=native -pipe -fno-semantic-interposition "
export LDFLAGS="-Wl,-O2 -Wl,--as-needed "
Configure script fails:
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking whether x86_64-optimux-linux-musl-g++ supports C++11 features by default... no
checking whether x86_64-optimux-linux-musl-g++ supports C++11 features with -std=gnu++11... no
checking whether x86_64-optimux-linux-musl-g++ supports C++11 features with -std=gnu++0x... no
checking whether x86_64-optimux-linux-musl-g++ supports C++11 features with -std=c++11... no
checking whether x86_64-optimux-linux-musl-g++ supports C++11 features with +std=c++11... no
checking whether x86_64-optimux-linux-musl-g++ supports C++11 features with -h std=c++11... no
checking whether x86_64-optimux-linux-musl-g++ supports C++11 features with -std=c++0x... no
checking whether x86_64-optimux-linux-musl-g++ supports C++11 features with +std=c++0x... no
checking whether x86_64-optimux-linux-musl-g++ supports C++11 features with -h std=c++0x... no
configure: error: *** A compiler with support for C++11 language features is required.
Yet compiler in cross-tools does have c++11 support:
$ echo 'int main(){}' > dummy.c
$ /cross-tools/bin/x86_64-optimux-linux-musl-g++ -std=gnu++11 dummy.c
... yields no errors
GDK-pixbuf builds but cannot install:
Running custom install script '/usr/bin/meson --internal gettext install --subdir=po --localedir=share/locale --pkgname=gdk-pixbuf'
--- stdout ---
--- stderr ---
Traceback (most recent call last):
File "/usr/bin/meson", line 33, in <module>
sys.exit(load_entry_point('meson==0.59.0', 'console_scripts', 'meson')())
File "/usr/lib/python3.9/site-packages/mesonbuild/mesonmain.py", line 325, in main
return run(sys.argv[1:], launcher)
File "/usr/lib/python3.9/site-packages/mesonbuild/mesonmain.py", line 313, in run
return run_script_command(args[1], args[2:])
File "/usr/lib/python3.9/site-packages/mesonbuild/mesonmain.py", line 261, in run_script_command
return module.run(script_args)
File "/usr/lib/python3.9/site-packages/mesonbuild/scripts/gettext.py", line 119, in run
if gen_gmo(src_sub, bld_sub, langs) != 0:
File "/usr/lib/python3.9/site-packages/mesonbuild/scripts/gettext.py", line 66, in gen_gmo
subprocess.check_call(['msgfmt', os.path.join(src_sub, l + '.po'),
File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['msgfmt', '/src/gdk-pixbuf-2.42.6/po/ar.po', '-o', '/src/gdk-pixbuf-2.42.6/build/po/ar.gmo']' died with <Signals.SIGSEGV: 11>.
FAILED: install script '/usr/bin/meson --internal gettext install --subdir=po --localedir=share/locale --pkgname=gdk-pixbuf' exit code 1, stopped
ninja: job failed: /usr/bin/meson install --no-rebuild
ninja: subcommand failed
If i run the failing command:
$ msgfmt /src/gdk-pixbuf-2.42.6/po/ar.po -o /src/gdk-pixbuf-2.42.6/build/po/ar.gmo
fopen: Permission denied
But as root:
$ sudo msgfmt /src/gdk-pixbuf-2.42.6/po/ar.po -o /src/gdk-pixbuf-2.42.6/build/po/ar.gmo
Segmentation fault
Building Vim.... tries to link to host's Xorg libs.
Prevent with --enable-gui=no --without-x
Shouldn't /bin be sym-linked to /usr/bin as in here?
I am asking this because groff complained about the lack of perl in /bin which has already been installed in /usr/bin
"$i" in m) echo g;; esac; done; fi`m
/bin/sh: /tools/bin/makeinfo: /bin/perl: bad interpreter: No such file or directory
make[2]: *** [Makefile:11891: doc/groff.info] Error 126
make[2]: *** Waiting for unfinished jobs....
Or are there any reasons not to do so?
Machine boots up with kernel and rootfs but I cannot log in.
Login prompt shows but when I enter user name (even root), system hesitates, clears terminal then show login prompt. If I modify the boot scripts so that tty1 autologins with message "autologin tty1", machine boots with no prompt and just prints to terminal: "autologin tty1" repeatedly nonstop.
If I boot another system (i.e. CMLFS) I can easily chroot into built Optimux rootfs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.