Skip to content

cross compile with LLVM and sysroots#1129

Open
jjhelmus wants to merge 1 commit into
mainfrom
llvm_cross_others
Open

cross compile with LLVM and sysroots#1129
jjhelmus wants to merge 1 commit into
mainfrom
llvm_cross_others

Conversation

@jjhelmus
Copy link
Copy Markdown
Contributor

Cross compiler with LLVM and a sysroot in all cases

Follow up to #1101 to expand to all architectures

@jjhelmus jjhelmus added platform:linux Specific to the Linux platform python:all Select all Python versions arch:all Select all architectures build:all labels May 12, 2026
wojiushixiaobai referenced this pull request in loong64/python-build-standalone May 13, 2026
(cherry picked from commit 04e2962)
Signed-off-by: 吴小白 <296015668@qq.com>
@wojiushixiaobai
Copy link
Copy Markdown
Contributor

# ldd ./python_lto/install/bin/python
	linux-vdso.so.1 (0x00007f522190b000)
	libm.so.6 => /lib/loongarch64-linux-gnu/libm.so.6 (0x00007f5216a80000)
	libc.so.6 => /lib/loongarch64-linux-gnu/libc.so.6 (0x00007f52168b0000)
	/lib64/ld-linux-loongarch-lp64d.so.1 (0x00007f52218c0000)
# ./python_lto/install/bin/python -V
Python 3.11.15
# file ./python_lto/install/bin/python3.11
./python_lto/install/bin/python3.11: ELF 64-bit LSB pie executable, LoongArch, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-loongarch-lp64d.so.1, for GNU/Linux 5.19.0, with debug_info, not stripped
# readelf -l python_lto/install/bin/python

Elf file type is DYN (Position-Independent Executable file)
Entry point 0x1f0f98
There are 11 program headers, starting at offset 64

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  PHDR           0x0000000000000040 0x0000000000000040 0x0000000000000040
                 0x0000000000000268 0x0000000000000268  R      0x8
  LOAD           0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000e66b50 0x0000000000e66b50  R E    0x10000
  GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000  RW     0x10
  GNU_EH_FRAME   0x0000000000e664a4 0x0000000000e664a4 0x0000000000e664a4
                 0x0000000000000174 0x0000000000000174  R      0x4
  LOAD           0x0000000000e6f650 0x0000000000e7f650 0x0000000000e7f650
                 0x0000000000219650 0x0000000000266270  RW     0x10000
  GNU_RELRO      0x0000000000e6f650 0x0000000000e7f650 0x0000000000e7f650
                 0x00000000000d09b0 0x00000000000d09b0  R      0x1
  DYNAMIC        0x00000000024b0000 0x00000000024b0000 0x00000000024b0000
                 0x00000000000001e0 0x00000000000001e0  RW     0x8
  LOAD           0x00000000024b0000 0x00000000024b0000 0x00000000024b0000
                 0x0000000000009e68 0x0000000000009e68  RW     0x10000
  INTERP         0x00000000024b9da8 0x00000000024b9da8 0x00000000024b9da8
                 0x0000000000000025 0x0000000000000025  R      0x1
      [Requesting program interpreter: /lib64/ld-linux-loongarch-lp64d.so.1]
  NOTE           0x00000000024b9dd0 0x00000000024b9dd0 0x00000000024b9dd0
                 0x0000000000000020 0x0000000000000020  R      0x4
  NOTE           0x00000000024b9df0 0x00000000024b9df0 0x00000000024b9df0
                 0x0000000000000078 0x0000000000000078  R      0x4

 Section to Segment mapping:
  Segment Sections...
   00     
   01     .gnu.hash .dynsym .gnu.version .gnu.version_r .rela.dyn .rela.plt .plt .text .rodata .eh_frame_hdr .eh_frame 
   02     
   03     .eh_frame_hdr 
   04     .init_array .fini_array .data.rel.ro .got .got.plt .data .PyRuntime .sdata .bss 
   05     .init_array .fini_array .data.rel.ro .got 
   06     .dynamic 
   07     .dynamic .dynstr .interp .note.ABI-tag .note.package 
   08     .interp 
   09     .note.ABI-tag 
   10     .note.package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch:all Select all architectures build:all platform:linux Specific to the Linux platform python:all Select all Python versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants