Compiled on RPI4B-4G with 5.10.77-piCore-v8 Compile Flags: # must be passed as CC CXX CC='gcc -march=armv8-a+crc -mtune=cortex-a72 -Os -pipe -flto -fuse-linker-plugin -fno-exceptions' CXX='g++ -march=armv8-a+crc -mtune=cortex-a72 -Os -pipe -flto -fuse-linker-plugin -fno-exceptions -fno-rtti' LDFLAGS='-Wl,-O1' export CC CXX LDFLAGS Dependencies: compiletc perl5 nspr-dev sqlite3-dev llvm-bin Commands: cd /tmp wget https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_76_RTM/src/nss-3.76.tar.gz wget https://www.linuxfromscratch.org/patches/blfs/svn/nss-3.75-standalone-1.patch P=/usr/local/libexec/gcc/aarch64-unknown-linux-gnu/10.2.0/liblto_plugin.so.0.0.0 sudo mkdir -p /usr/local/lib/bfd-plugins sudo ln -sfv $P /usr/local/lib/bfd-plugins/liblto_plugin.so tar -xf nss-3.76.tar.gz cd nss-3.76/nss/ patch -Np2 < ../../nss-3.75-standalone-1.patch # checking # find . -name Makefile -exec grep --color '\-g' {} + # find . -name Linux.mk -exec grep --color '\-O[0-9]' {} + find . -name Makefile -type f -exec sed -i 's/ -g//g' {} \; find . -name Makefile -type f -exec sed -i 's/ -O2//g' {} \; find . -name Linux.mk -type f -exec sed -i 's/ -O2//g' {} \; time make -j4 CC='gcc -march=armv8-a+crc -mtune=cortex-a72 -Os -pipe -flto -fuse-linker-plugin -fno-exceptions' CXX='g++ -march=armv8-a+crc -mtune=cortex-a72 -Os -pipe -flto -fuse-linker-plugin -fno-exceptions -fno-rtti' BUILD_OPT=1 NSPR_INCLUDE_DIR=/usr/local/include/nspr USE_SYSTEM_ZLIB=1 ZLIB_LIBS=-lz NSS_ENABLE_WERROR=0 NSS_USE_SYSTEM_SQLITE=1 USE_64=1 real 18m 42.52s user 1h 7m 23s sys 3m 43.83s # /tmp/nss-3.76/dist cd ../dist # dev mkdir -p /tmp/packing-nss-dev/usr/local/lib/pkgconfig install -m644 Linux*/lib/libcrmf.a /tmp/packing-nss-dev/usr/local/lib/ install -m644 Linux*/lib/pkgconfig/nss.pc /tmp/packing-nss-dev/usr/local/lib/pkgconfig/ install -Dm755 Linux*/bin/nss-config -t /tmp/packing-nss-dev/usr/local/bin/ mkdir -p /tmp/packing-nss-dev/usr/local/include/nss install -m644 public/nss/* /tmp/packing-nss-dev/usr/local/include/nss/ install -m644 private/nss/* /tmp/packing-nss-dev/usr/local/include/nss/ # main # https://bugzilla.redhat.com/show_bug.cgi?id=173537 # make sure *chk and *so are in the same directory mkdir -p /tmp/packing-nss/usr/local/lib install -m775 Linux*/lib/*so /tmp/packing-nss/usr/local/lib/ install -m644 Linux*/lib/*chk /tmp/packing-nss-dev/usr/local/lib/ install -Dm775 Linux*/bin/certutil -t /tmp/packing-nss/usr/local/bin/ install -Dm775 Linux*/bin/pk12util -t /tmp/packing-nss/usr/local/bin/ # edit nss.pc # prefix=/usr/local sed -i '/^prefix=/ c prefix=/usr/local' /tmp/packing-nss-dev/usr/local/lib/pkgconfig/nss.pc # nss-config sed -i '/^prefix=/ c prefix=/usr/local' /tmp/packing-nss-dev/usr/local/bin/nss-config # strip find /tmp/packing-nss -type f -exec file {} ';' | grep ELF | cut -d : -f 1 | xargs strip --strip-unneeded llvm-strip --strip-debug /tmp/packing-nss-dev/usr/local/lib/libcrmf.a