WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: armhf TC15  (Read 639 times)

Offline polikuo

  • Hero Member
  • *****
  • Posts: 765
armhf TC15
« on: December 10, 2024, 04:45:05 AM »
Hi all.

A couple of notes:
  • armv6/7/7l repos have been replaced by an armhf repo, which contains 32 bit extensions
  • When using 32bit images, the pi4 and pi5 will use a 64bit kernel.  please make sure to look at uname if manually downloading kernel module extensions. The 32bit armv7l kernel for the Pi4 is optional if you edit the config.txt on the boot drive.

What's the proper compile flags for armhf after the merge ? (I have 3B and 4B)
I'm planning to build distcc, firefox-perf for both 32-bit and 64-bit.
I'll need several other extensions, starting with lld from llvm on armhf.
I'm having trouble figuring out the proper triplet.
Clang is unhappy with my input in general.

I'm currently running on a fresh installation of armhf.
The test below is performed with (tce-load -wil compiletc clang)
Code: [Select]
tc@pi4-1:/tmp/tmp.wXoY5k$ ls
return_0.c
tc@pi4-1:/tmp/tmp.wXoY5k$ cat return_0.c
int main(void) {
  return 0;
}
tc@pi4-1:/tmp/tmp.wXoY5k$ gcc return_0.c -o gcc-no-arg
# compiles without trouble
tc@pi4-1:/tmp/tmp.wXoY5k$ clang return_0.c -o clang-no-arg
/usr/local/bin/ld: cannot find crtbeginS.o: No such file or directory
/usr/local/bin/ld: cannot find -lgcc: No such file or directory
/usr/local/bin/ld: cannot find -lgcc: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
tc@pi4-1:/tmp/tmp.wXoY5k$ realpath /usr/local/bin/ld
/tmp/tcloop/binutils/usr/local/bin/ld

Passing "--verbose" to the linker
Code: [Select]
tc@pi4-1:/tmp/tmp.wXoY5k$ clang return_0.c -o clang-verbose  -Wl,--verbose
GNU ld (GNU Binutils) 2.42
  Supported emulations:
   armelf_linux_eabi
   armelfb_linux_eabi
using internal linker script:
==================================================
/* Script for -pie -z combreloc */
/* Copyright (C) 2014-2024 Free Software Foundation, Inc.
   Copying and distribution of this script, with or without modification,
   are permitted in any medium without royalty provided the copyright
   notice and this notice are preserved.  */
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
              "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SEARCH_DIR("/usr/local/armv7l-unknown-linux-gnueabihf/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
SECTIONS
{
  /* Read-only sections, merged into text segment: */
  PROVIDE (__executable_start = SEGMENT_START("text-segment", 0)); . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
  .interp         : { *(.interp) }
  .note.gnu.build-id  : { *(.note.gnu.build-id) }
  .hash           : { *(.hash) }
  .gnu.hash       : { *(.gnu.hash) }
  .dynsym         : { *(.dynsym) }
  .dynstr         : { *(.dynstr) }
  .gnu.version    : { *(.gnu.version) }
  .gnu.version_d  : { *(.gnu.version_d) }
  .gnu.version_r  : { *(.gnu.version_r) }
  .rel.dyn        :
    {
      *(.rel.init)
      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
      *(.rel.fini)
      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
      *(.rel.data.rel.ro .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*)
      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
      *(.rel.ctors)
      *(.rel.dtors)
      *(.rel.got)
      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
      *(.rel.iplt)
    }
  .rela.dyn       :
    {
      *(.rela.init)
      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
      *(.rela.fini)
      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
      *(.rela.ctors)
      *(.rela.dtors)
      *(.rela.got)
      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
      *(.rela.iplt)
    }
  .rel.plt        :
    {
      *(.rel.plt)
    }
  .rela.plt       :
    {
      *(.rela.plt)
    }
  .init           :
  {
    KEEP (*(SORT_NONE(.init)))
  }
  .plt            : { *(.plt) }
  .iplt           : { *(.iplt) }
  .text           :
  {
    *(.text.unlikely .text.*_unlikely .text.unlikely.*)
    *(.text.exit .text.exit.*)
    *(.text.startup .text.startup.*)
    *(.text.hot .text.hot.*)
    *(SORT(.text.sorted.*))
    *(.text .stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf.em.  */
    *(.gnu.warning)
    *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)
  }
  .fini           :
  {
    KEEP (*(SORT_NONE(.fini)))
  }
  PROVIDE (__etext = .);
  PROVIDE (_etext = .);
  PROVIDE (etext = .);
  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  .rodata1        : { *(.rodata1) }
  .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) }
  .ARM.exidx   :
    {
      PROVIDE_HIDDEN (__exidx_start = .);
      *(.ARM.exidx* .gnu.linkonce.armexidx.*)
      PROVIDE_HIDDEN (__exidx_end = .);
    }
  .eh_frame_hdr   : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) }
  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  .sframe         : ONLY_IF_RO { *(.sframe) *(.sframe.*) }
  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
  .gnu_extab   : ONLY_IF_RO { *(.gnu_extab*) }
  /* These sections are generated by the Sun/Oracle C++ compiler.  */
  .exception_ranges   : ONLY_IF_RO { *(.exception_ranges*) }
  /* Adjust the address for the data segment.  We want to adjust up to
     the same address within the page on the next page up.  */
  . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  /* Exception handling  */
  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) }
  .sframe         : ONLY_IF_RW { *(.sframe) *(.sframe.*) }
  .gnu_extab      : ONLY_IF_RW { *(.gnu_extab) }
  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  .exception_ranges   : ONLY_IF_RW { *(.exception_ranges*) }
  /* Thread Local Storage sections  */
  .tdata          :
   {
     PROVIDE_HIDDEN (__tdata_start = .);
     *(.tdata .tdata.* .gnu.linkonce.td.*)
   }
  .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  .preinit_array    :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  }
  .init_array    :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
    KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
    PROVIDE_HIDDEN (__init_array_end = .);
  }
  .fini_array    :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
    KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
    PROVIDE_HIDDEN (__fini_array_end = .);
  }
  .ctors          :
  {
    /* gcc uses crtbegin.o to find the start of
       the constructors, so we make sure it is
       first.  Because this is a wildcard, it
       doesn't matter if the user does not
       actually link against crtbegin.o; the
       linker won't look for a file to match a
       wildcard.  The wildcard also means that it
       doesn't matter which directory crtbegin.o
       is in.  */
    KEEP (*crtbegin.o(.ctors))
    KEEP (*crtbegin?.o(.ctors))
    /* We don't want to include the .ctor section from
       the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
  }
  .dtors          :
  {
    KEEP (*crtbegin.o(.dtors))
    KEEP (*crtbegin?.o(.dtors))
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
  }
  .jcr            : { KEEP (*(.jcr)) }
  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  .dynamic        : { *(.dynamic) }
  . = DATA_SEGMENT_RELRO_END (0, .);
  .got            : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }
  .data           :
  {
    PROVIDE (__data_start = .);
    *(.data .data.* .gnu.linkonce.d.*)
    SORT(CONSTRUCTORS)
  }
  .data1          : { *(.data1) }
  _edata = .; PROVIDE (edata = .);
  . = ALIGN(ALIGNOF(NEXT_SECTION));
  __bss_start = .;
  __bss_start__ = .;
  .bss            :
  {
   *(.dynbss)
   *(.bss .bss.* .gnu.linkonce.b.*)
   *(COMMON)
   /* Align here to ensure that the .bss section occupies space up to
      _end.  Align after .bss to ensure correct alignment even if the
      .bss section disappears because there are no input sections.
      FIXME: Why do we need it? When there is no .bss section, we do not
      pad the .data section.  */
   . = ALIGN(. != 0 ? 32 / 8 : 1);
  }
  _bss_end__ = .; __bss_end__ = .;
  . = ALIGN(32 / 8);
  . = SEGMENT_START("ldata-segment", .);
  . = ALIGN(32 / 8);
  __end__ = .;
  _end = .; PROVIDE (end = .);
  . = DATA_SEGMENT_END (.);
  /* Stabs debugging sections.  */
  .stab          0 : { *(.stab) }
  .stabstr       0 : { *(.stabstr) }
  .stab.excl     0 : { *(.stab.excl) }
  .stab.exclstr  0 : { *(.stab.exclstr) }
  .stab.index    0 : { *(.stab.index) }
  .stab.indexstr 0 : { *(.stab.indexstr) }
  .comment 0 (INFO) : { *(.comment); LINKER_VERSION; }
  .gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0.  */
  /* DWARF 1.  */
  .debug          0 : { *(.debug) }
  .line           0 : { *(.line) }
  /* GNU DWARF 1 extensions.  */
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
  .debug_sfnames  0 : { *(.debug_sfnames) }
  /* DWARF 1.1 and DWARF 2.  */
  .debug_aranges  0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  /* DWARF 2.  */
  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
  .debug_abbrev   0 : { *(.debug_abbrev) }
  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end) }
  .debug_frame    0 : { *(.debug_frame) }
  .debug_str      0 : { *(.debug_str) }
  .debug_loc      0 : { *(.debug_loc) }
  .debug_macinfo  0 : { *(.debug_macinfo) }
  /* SGI/MIPS DWARF 2 extensions.  */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames  0 : { *(.debug_varnames) }
  /* DWARF 3.  */
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
  .debug_ranges   0 : { *(.debug_ranges) }
  /* DWARF 5.  */
  .debug_addr     0 : { *(.debug_addr) }
  .debug_line_str 0 : { *(.debug_line_str) }
  .debug_loclists 0 : { *(.debug_loclists) }
  .debug_macro    0 : { *(.debug_macro) }
  .debug_names    0 : { *(.debug_names) }
  .debug_rnglists 0 : { *(.debug_rnglists) }
  .debug_str_offsets 0 : { *(.debug_str_offsets) }
  .debug_sup      0 : { *(.debug_sup) }
  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
}


==================================================
/usr/local/bin/ld: mode armelf_linux_eabi
attempt to open /usr/lib/../lib/Scrt1.o succeeded
/usr/lib/../lib/Scrt1.o
attempt to open /usr/lib/../lib/crti.o succeeded
/usr/lib/../lib/crti.o
attempt to open crtbeginS.o failed
/usr/local/bin/ld: cannot find crtbeginS.o: No such file or directory
attempt to open /tmp/return_0-b5ecd2.o succeeded
/tmp/return_0-b5ecd2.o
attempt to open /lib/../lib/libgcc.so failed
attempt to open /lib/../lib/libgcc.a failed
attempt to open /usr/lib/../lib/libgcc.so failed
attempt to open /usr/lib/../lib/libgcc.a failed
attempt to open /lib/libgcc.so failed
attempt to open /lib/libgcc.a failed
attempt to open /usr/lib/libgcc.so failed
attempt to open /usr/lib/libgcc.a failed
attempt to open /usr/local/armv7l-unknown-linux-gnueabihf/lib/libgcc.so failed
attempt to open /usr/local/armv7l-unknown-linux-gnueabihf/lib/libgcc.a failed
attempt to open /usr/local/lib/libgcc.so failed
attempt to open /usr/local/lib/libgcc.a failed
attempt to open /lib/libgcc.so failed
attempt to open /lib/libgcc.a failed
attempt to open /usr/lib/libgcc.so failed
attempt to open /usr/lib/libgcc.a failed
/usr/local/bin/ld: cannot find -lgcc: No such file or directory
attempt to open /lib/../lib/libgcc.so failed
attempt to open /lib/../lib/gcc.a failed
attempt to open /usr/lib/../lib/libgcc.so failed
attempt to open /usr/lib/../lib/gcc.a failed
attempt to open /lib/libgcc.so failed
attempt to open /lib/gcc.a failed
attempt to open /usr/lib/libgcc.so failed
attempt to open /usr/lib/gcc.a failed
attempt to open /usr/local/armv7l-unknown-linux-gnueabihf/lib/libgcc.so failed
attempt to open /usr/local/armv7l-unknown-linux-gnueabihf/lib/gcc.a failed
attempt to open /usr/local/lib/libgcc.so failed
attempt to open /usr/local/lib/gcc.a failed
attempt to open /lib/libgcc.so failed
attempt to open /lib/gcc.a failed
attempt to open /usr/lib/libgcc.so failed
attempt to open /usr/lib/gcc.a failed
attempt to open /lib/../lib/libgcc_s.so failed
attempt to open /lib/../lib/libgcc_s.a failed
attempt to open /usr/lib/../lib/libgcc_s.so succeeded
opened script file /usr/lib/../lib/libgcc_s.so
/usr/lib/../lib/libgcc_s.so
opened script file /usr/lib/../lib/libgcc_s.so
attempt to open /usr/lib/../lib/libgcc_s.so.1 succeeded
/usr/lib/../lib/libgcc_s.so.1
attempt to open /lib/../lib/libgcc.so failed
attempt to open /lib/../lib/libgcc.a failed
attempt to open /usr/lib/../lib/libgcc.so failed
attempt to open /usr/lib/../lib/libgcc.a failed
attempt to open /lib/libgcc.so failed
attempt to open /lib/libgcc.a failed
attempt to open /usr/lib/libgcc.so failed
attempt to open /usr/lib/libgcc.a failed
attempt to open /usr/local/armv7l-unknown-linux-gnueabihf/lib/libgcc.so failed
attempt to open /usr/local/armv7l-unknown-linux-gnueabihf/lib/libgcc.a failed
attempt to open /usr/local/lib/libgcc.so failed
attempt to open /usr/local/lib/libgcc.a failed
attempt to open /lib/libgcc.so failed
attempt to open /lib/libgcc.a failed
attempt to open /usr/lib/libgcc.so failed
attempt to open /usr/lib/libgcc.a failed
/usr/local/bin/ld: cannot find -lgcc: No such file or directory
attempt to open /lib/../lib/libgcc.so failed
attempt to open /lib/../lib/gcc.a failed
attempt to open /usr/lib/../lib/libgcc.so failed
attempt to open /usr/lib/../lib/gcc.a failed
attempt to open /lib/libgcc.so failed
attempt to open /lib/gcc.a failed
attempt to open /usr/lib/libgcc.so failed
attempt to open /usr/lib/gcc.a failed
attempt to open /usr/local/armv7l-unknown-linux-gnueabihf/lib/libgcc.so failed
attempt to open /usr/local/armv7l-unknown-linux-gnueabihf/lib/gcc.a failed
attempt to open /usr/local/lib/libgcc.so failed
attempt to open /usr/local/lib/gcc.a failed
attempt to open /lib/libgcc.so failed
attempt to open /lib/gcc.a failed
attempt to open /usr/lib/libgcc.so failed
attempt to open /usr/lib/gcc.a failed
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The location of crtbeginS.o
Code: [Select]
tc@pi4-1:/tmp/tmp.wXoY5k$ find /tmp/tcloop/gcc -name crtbeginS.o
/tmp/tcloop/gcc/usr/local/lib/gcc/armv7l-unknown-linux-gnueabihf/13.2.0/crtbeginS.o

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1291
Re: armhf TC15
« Reply #1 on: December 10, 2024, 06:39:58 AM »
Are you on your 4B.  Juanito mentioned that llvm/clang did not like the 64bit kernel and building in 32bit userspace.  You can switch to the 32bit kernel and try.

Offline polikuo

  • Hero Member
  • *****
  • Posts: 765
Re: armhf TC15
« Reply #2 on: December 10, 2024, 07:30:34 AM »
Hi, Paul.

Yes, I'm using Pi4

I managed to got it working, you just need to specify the GCC installation.
Code: [Select]
CC='clang --gcc-install-dir=/usr/local/lib/gcc/armv7l-unknown-linux-gnueabihf/13.2.0'
CXX='clang++ --gcc-install-dir=/usr/local/lib/gcc/armv7l-unknown-linux-gnueabihf/13.2.0'
CFLAGS='-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe'
CXXFLAGS='-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe'
EXTRA_C=' -L/usr/local/lib -flto=thin -fuse-ld=lld -fno-exceptions'
EXTRA_CXX=' -L/usr/local/lib -flto=thin -fuse-ld=lld -fno-exceptions -fno-rtti'
CFLAGS="${CFLAGS}${EXTRA_C}"
CXXFLAGS="${CXXFLAGS}${EXTRA_CXX}"
LDFLAGS='-L/usr/local/lib -Wl,-O1 -Wl,-rpath=/usr/local/lib'
export CC CXX CFLAGS CXXFLAGS LDFLAGS

Offline polikuo

  • Hero Member
  • *****
  • Posts: 765
Re: armhf TC15
« Reply #3 on: December 10, 2024, 10:05:28 AM »
Hi

I'm compiling lld.tcz on RPI4-8G (piCore15 default 64-bit kernel, armhf user space)

Just wanna document my LTO test result here

gcc-outcome (-flto), lld (-flto), lld-full (-flto=full), lld-thin (-flto=thin)

Code: [Select]
tc@pi4-1:/mnt/sda1/unstripped-copies$ du -hd0 *
117.6M  gcc-outcome
62.0M   lld
61.7M   lld-full
63.7M   lld-thin
tc@pi4-1:/tmp/stripped$ du -hd0 *
102.6M  gcc-outcome
54.9M   lld
54.6M   lld-full
55.2M   lld-thin

GCC + GOLD produce larger .a files
Clang + LLD produce larger bin files

They are bundled, so I think I'll submit the lld-full one, which has the smallest overall size.
« Last Edit: December 10, 2024, 10:07:08 AM by polikuo »

Offline polikuo

  • Hero Member
  • *****
  • Posts: 765
Re: armhf TC15
« Reply #4 on: January 08, 2025, 10:59:29 PM »
Hi.

I'm trying to compile firefox for armhf.
I'm having memory problem even though I'm using 64-bit kernel.
Code: [Select]
tc@pi4-1:/mnt/mmcblk0p5/compile/firefox-128.6.0$ getBuild
armhf
tc@pi4-1:/mnt/mmcblk0p5/compile/firefox-128.6.0$ uname -m
aarch64

I've tried limiting the job count to 1, but I'm still out of memory.
on idle:
Code: [Select]
tc@pi4-1:/mnt/mmcblk0p5/compile/firefox-128.6.0$ free -m
               total        used        free      shared  buff/cache   available
Mem:            7809        1686        4016          79        2333        6123
Swap:          11046        2439        8606

Code: [Select]
1:23.70    Compiling gkrust v0.1.0 (/mnt/mmcblk0p5/compile/firefox-128.6.0/toolkit/library/rust)
 3:13.96 rustc-LLVM ERROR: out of memory
 3:13.97 Allocation failed
 3:14.37 error: could not compile `gkrust` (lib)
 3:14.37 Caused by:
 3:14.44   process didn't exit successfully: `/usr/local/bin/rustc --crate-name gkrust --edition=2015 toolkit/library/rust/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type staticlib --emit=dep-info,link -C opt-level=3 -C panic=abort -C embed-bitcode=no -Clto --cfg 'feature="mozilla-central-workspace-hack"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("mozilla-central-workspace-hack"))' -C metadata=dcae7df97c342de5 -C extra-filename=-dcae7df97c342de5 --out-dir /mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/armv7-unknown-linux-gnueabihf/release/deps --target armv7-unknown-linux-gnueabihf -C linker=/mnt/mmcblk0p5/compile/firefox-128.6.0/build/cargo-linker -C strip=debuginfo -L dependency=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/armv7-unknown-linux-gnueabihf/release/deps -L dependency=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/release/deps --extern gkrust_shared=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/armv7-unknown-linux-gnueabihf/release/deps/libgkrust_shared-03860171d9b6272f.rlib --extern lmdb_sys=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/armv7-unknown-linux-gnueabihf/release/deps/liblmdb_sys-0395da53f835fe73.rlib --extern mozglue_static=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/armv7-unknown-linux-gnueabihf/release/deps/libmozglue_static-e4a69114f4610c84.rlib --extern mozilla_central_workspace_hack=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/armv7-unknown-linux-gnueabihf/release/deps/libmozilla_central_workspace_hack-b09b73a3edf9b377.rlib --extern swgl=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/armv7-unknown-linux-gnueabihf/release/deps/libswgl-8d17479a0a1fe4f5.rlib -C debuginfo=2 --cap-lints warn -C linker-plugin-lto -C linker=clang -C link-arg=-fuse-ld=lld -Cembed-bitcode=yes -C codegen-units=1 -L native=/usr/local/lib -L native=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/armv7-unknown-linux-gnueabihf/release/build/audioipc2-780fd2aa325a06f5/out -L native=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/dist/bin -L native=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/security/nss/lib/nss/nss_nss3 -L native=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/security/nss/lib/ssl/ssl_ssl3 -L native=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/config/external/nspr/pr -L native=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/armv7-unknown-linux-gnueabihf/release/build/lmdb-rkv-sys-1424ee2c80c44647/out -L native=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/dist/bin -L native=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/security/nss/lib/nss/nss_nss3 -L native=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/security/nss/lib/ssl/ssl_ssl3 -L native=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/config/external/nspr/pr -L native=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/armv7-unknown-linux-gnueabihf/release/build/mozglue-static-c9c623b696a7a154/out -L native=/usr/local/lib -L native=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/dist/bin -L native=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/security/nss/lib/nss/nss_nss3 -L native=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/security/nss/lib/ssl/ssl_ssl3 -L native=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/config/external/nspr/pr -L native=/mnt/mmcblk0p5/compile/firefox-128.6.0/firefox-build-dir/instrumented/armv7-unknown-linux-gnueabihf/release/build/swgl-a2e1df84fb653dc0/out` (signal: 6, SIGABRT: process abort signal)
 3:15.50 make[4]: *** [/mnt/mmcblk0p5/compile/firefox-128.6.0/config/makefiles/rust.mk:498: force-cargo-library-build] Error 101
 3:15.50 make[3]: *** [/mnt/mmcblk0p5/compile/firefox-128.6.0/config/recurse.mk:72: toolkit/library/rust/target-objects] Error 2
 3:15.50 make[2]: *** [/mnt/mmcblk0p5/compile/firefox-128.6.0/config/recurse.mk:34: compile] Error 2
 3:15.51 make[1]: *** [/mnt/mmcblk0p5/compile/firefox-128.6.0/config/rules.mk:361: default] Error 2
 3:15.51 make: *** [client.mk:60: build] Error 2
 3:15.70 W 25 compiler warnings present.
Command exited with non-zero status 2
real    3m 21.20s
user    3m 29.33s
sys     0m 32.07s
« Last Edit: January 08, 2025, 11:03:20 PM by polikuo »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14867
Re: armhf TC15
« Reply #5 on: January 09, 2025, 02:39:29 AM »
Does a swap partition or swap file help?

The last time I tried, I’m pretty sure it was an illegal instruction that stopped things.

Offline polikuo

  • Hero Member
  • *****
  • Posts: 765
Re: armhf TC15
« Reply #6 on: January 09, 2025, 04:33:49 AM »
I tried compiling on RPI4-4G instead of RPI4-8G to encourage swapping.
The process was killed when the swap usage was somewhere around 3G

On idle
Code: [Select]
tc@pi4-1:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3792          54        3697          11          41        3685
Swap:         40173           0       40173

Right before the process was killed
Code: [Select]
top - 17:28:24 up 19 min,  3 users,  load average: 1.83, 1.21, 0.60
Tasks: 169 total,   1 running, 168 sleeping,   0 stopped,   0 zombie
%Cpu0  :  11.0/9.7    21[||          ]   %Cpu1  :  10.3/6.8    17[||          ]
%Cpu2  :   6.0/3.3     9[|           ]   %Cpu3  :   7.2/4.6    12[||          ]
GiB Mem : 96.3/3.7      [||||||||| ]   GiB Swap:  3.4/39.2     [|            ]

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1291
Re: armhf TC15
« Reply #7 on: January 09, 2025, 06:42:45 AM »
That’s the same wall I ran into a few years back.  I could not find any useful help with 32bit systems.

Would the Debian/RaspiOS package build scripts provide any useful help?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14867
Re: armhf TC15
« Reply #8 on: January 09, 2025, 09:01:57 AM »
My last attempt fails with this:
Code: [Select]
In file included from /mnt/sda8/usr/src/firefox-128.2.0/firefox-build-dir/dist/stl_wrappers/new:62:
configure pre-export export compile misc libs tools
warning /mnt/sda8/usr/src/firefox-128.2.0/firefox-build-dir/dist/system_wrappers/new:3:15: fatal error: 'new' file not found

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11735
Re: armhf TC15
« Reply #9 on: January 09, 2025, 09:25:43 AM »
Hi polikuo
I'm trying to compile firefox for armhf.
I'm having memory problem even though I'm using 64-bit kernel.
Code: [Select]
tc@pi4-1:/mnt/mmcblk0p5/compile/firefox-128.6.0$ getBuild
armhf
tc@pi4-1:/mnt/mmcblk0p5/compile/firefox-128.6.0$ uname -m
aarch64

I've tried limiting the job count to 1, but I'm still out of memory.
on idle:
Code: [Select]
tc@pi4-1:/mnt/mmcblk0p5/compile/firefox-128.6.0$ free -m
               total        used        free      shared  buff/cache   available
Mem:            7809        1686        4016          79        2333        6123
Swap:          11046        2439        8606
...
You're using a 64bit kernel, but a 32 bit toolchain. Right?

So that means the 64 bit kernel can allocate all available
RAM to various running apps.

But any 32 bit app needing more than 3.5 - 4 Gig of RAM
will still run out of memory because it can't address it.

Offline polikuo

  • Hero Member
  • *****
  • Posts: 765
Re: armhf TC15
« Reply #10 on: January 09, 2025, 09:49:34 AM »
That’s the same wall I ran into a few years back.  I could not find any useful help with 32bit systems.

Would the Debian/RaspiOS package build scripts provide any useful help?

Hi Paul

Could you kindly point out where can I find those information ?
I'm rather unfamiliar with their system.
I'm scratching my head looking at https://tracker.debian.org/pkg/firefox and https://salsa.debian.org/mozilla-team/firefox/-/tree/release/master/debian?ref_type=heads


You're using a 64bit kernel, but a 32 bit toolchain. Right?

So that means the 64 bit kernel can allocate all available
RAM to various running apps.

But any 32 bit app needing more than 3.5 - 4 Gig of RAM
will still run out of memory because it can't address it.

Hi, Rich.

I know that, I'm looking for working instructions
I'm currently testing out this modification
Code: [Select]
RUSTFLAGS="$RUSTFLAGS -C debuginfo=0"
My pi is still compiling, it's not there yet, not sure if it would work.
« Last Edit: January 09, 2025, 09:51:56 AM by polikuo »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11735
Re: armhf TC15
« Reply #11 on: January 09, 2025, 10:09:29 AM »
Hi polikuo
I did notice one other thing, not necessarily related:
...
Code: [Select]
  ----- Snip -----
 3:15.50 make[4]: *** [/mnt/mmcblk0p5/compile/firefox-128.6.0/config/makefiles/rust.mk:498: force-cargo-library-build] Error 101
  ----- Snip -----

If that's one of the codes listed in errno.h, it means:
Code: [Select]
#define ENETUNREACH     101     /* Network is unreachable */

Offline polikuo

  • Hero Member
  • *****
  • Posts: 765
Re: armhf TC15
« Reply #12 on: January 09, 2025, 06:55:53 PM »
Hi,
I managed to get beyond `gkrust`
but I'm stuck again with `libxul.so`
Code: [Select]
423:30.43 warning: `builtins-static` (build script) generated 2 warnings
423:31.67 LLVM ERROR: out of memory
423:31.67 Allocation failed
423:31.67 PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
423:31.68 LLVM ERROR: out of memory
423:31.68 Allocation failed
423:31.81 clang++: error: unable to execute command: Aborted
423:31.82 clang++: error: linker command failed due to signal (use -v to see invocation)
423:31.82 distcc[12254] ERROR: compile (null) on localhost failed
423:31.82 make[4]: *** [/mnt/mmcblk0p5/compile/firefox-128.6.0/config/rules.mk:541: ../../../dist/bin/libxul.so] Error 1
423:31.83 make[3]: *** [/mnt/mmcblk0p5/compile/firefox-128.6.0/config/recurse.mk:72: toolkit/library/build/target] Error 2
423:31.83 make[3]: *** Waiting for unfinished jobs....
423:45.59     Finished `release` profile [optimized] target(s) in 46.87s
423:46.60 security/manager/ssl/builtins/libbuiltins_static.a
423:46.61 make[2]: *** [/mnt/mmcblk0p5/compile/firefox-128.6.0/config/recurse.mk:34: compile] Error 2
423:46.62 make[1]: *** [/mnt/mmcblk0p5/compile/firefox-128.6.0/config/rules.mk:361: default] Error 2
423:46.62 make: *** [client.mk:60: build] Error 2
423:46.73 W 152 compiler warnings present.
424:27.46 /usr/local/bin/notify-send '--app-name=Mozilla Build System' 'Mozilla Build System' 'Build failed'
424:27.46 D Environment: {'USER': 'tc', 'MAIL': '/var/mail/tc', 'SSH_CLIENT': '192.168.18.14 36750 22', 'SHLVL': '1', 'HOME': '/home/tc', 'OLDPWD': '/usr/local/tce.installed', 'SSH_TTY': '/dev/pts/0', 'PAGER': 'less -EM', 'PS1': '\\u@\\h:\\w\\$ ', 'ENV': '/home/tc/.ashrc', 'BACKUP': '1', 'LOGNAME': 'tc', 'TERM': 'xterm', 'INCLUDE_SERVER_PORT': '/tmp/distcc-pump.85og76/socket', 'PATH': '/mnt/mmcblk0p5/compile/firefox-128.6.0/mozbuild/srcdirs/firefox-128.6.0-89a6938a84a0/_virtualenvs/build/bin:/mnt/mmcblk0p5/compile/firefox-128.6.0/mozbuild/srcdirs/firefox-128.6.0-89a6938a84a0/_virtualenvs/mach/bin:/tmp/tcloop/distcc/usr/local/bin:/home/tc/.local/bin:/usr/local/sbin:/usr/local/bin:/apps/bin:/usr/sbin:/usr/bin:/sbin:/bin:/etc/sysconfig/tcedir/ondemand', 'G_FILENAME_ENCODING': 'iso8859-1', 'LANG': 'zh_TW.utf8', 'MANPAGER': 'less -isR', 'SHELL': '/bin/sh', 'FLWM_TITLEBAR_COLOR': '58:7D:AA', 'INCLUDE_SERVER_PID': '7874', 'PWD': '/mnt/mmcblk0p5/compile/firefox-128.6.0', 'INCLUDE_SERVER_DIR': '/tmp/distcc-pump.85og76', 'SSH_CONNECTION': '192.168.18.14 36750 192.168.18.12 22', 'TZ': 'UTC-8', 'EDITOR': 'vi', 'VIRTUAL_ENV': '/mnt/mmcblk0p5/compile/firefox-128.6.0/mozbuild/srcdirs/firefox-128.6.0-89a6938a84a0/_virtualenvs/build', 'MACH_MAIN_PID': '16538', 'MACH_STDOUT_ISATTY': '1', 'PYTHONUNBUFFERED': '1'}
Command exited with non-zero status 2
real    7h 5m 44s
user    25h 37m 29s
sys     1h 0m 19s

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1291
Re: armhf TC15
« Reply #13 on: January 09, 2025, 08:02:48 PM »
The raspi repo is here  https://archive.raspberrypi.org/debian/pool/main/f/firefox/

This would be the latest package https://archive.raspberrypi.org/debian/pool/main/f/firefox/firefox_134.0-1+rpt8.debian.tar.xz

This has all of the debian/raspi patches and build information.   You will also see a boatload of files named firefox_134-orig*   these are all of the source files.  Most are localization files.

Obviously this is a very complicated build, and I am by no means an expert of the debian build system.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14867
Re: armhf TC15
« Reply #14 on: January 10, 2025, 04:29:26 AM »
Are you building on one RPi or using your multiple RPi hive thing?

If you're using multiple RPi, do you have a swap file/partition for each one?