Skip to content

unix/make: Fix 32bit libffi path. #17695

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yf13
Copy link
Contributor

@yf13 yf13 commented Jul 17, 2025

Summary

This fixes libffi.a link error when building 32bit standalone UNIX port on Ubuntu 22.04:

$ make -C ports/unix MICROPY_STANDALONE=1 MICROPY_FORCE_32BIT=1 CC=i686-linux-gnu-gcc CXX=i686-linux-gnu-g++ deplibs
$ make -C ports/unix MICROPY_STANDALONE=1 MICROPY_FORCE_32BIT=1 CC=i686-linux-gnu-gcc CXX=i686-linux-gnu-g++
...
LINK build-standard/micropython
/usr/lib/gcc-cross/i686-linux-gnu/11/../../../../i686-linux-gnu/bin/ld: cannot find build-standard/lib/libffi/out/lib32/libffi.a: No such file or directory
collect2: error: ld returned 1 exit status

Testing

Checked on Ubuntu 22.04 like:

$ make -C ports/unix MICROPY_STANDALONE=1 MICROPY_FORCE_32BIT=1 CC=i686-linux-gnu-gcc CXX=i686-linux-gnu-g++ deplibs
$ make -C ports/unix MICROPY_STANDALONE=1 MICROPY_FORCE_32BIT=1 CC=i686-linux-gnu-gcc CXX=i686-linux-gnu-g++
...
LINK build-standard/micropython
   text      data       bss       dec       hex   filename
 743657     35968      2788    782413     bf04d   build-standard/micropython
$ file ports/unix/build-standard/micropython
ports/unix/build-standard/micropython: ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=3c107769fefd7b467ca0b095ad1c6d28b1702826, for GNU/Linux 3.2.0, stripped
$ ldd ports/unix/build-standard/micropython
     linux-gate.so.1 (0xf7f7b000)
     libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7d8f000)
     libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7a00000)
     /lib/ld-linux.so.2 (0xf7f7d000)

This uses the same path of libffi.a for 32 or 64 bit builds so that
to be in line with logic of libffi near the end of this same Makefile.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
Copy link

codecov bot commented Jul 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.44%. Comparing base (628d53d) to head (cd8d523).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #17695   +/-   ##
=======================================
  Coverage   98.44%   98.44%           
=======================================
  Files         171      171           
  Lines       22208    22208           
=======================================
  Hits        21863    21863           
  Misses        345      345           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

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

Successfully merging this pull request may close these issues.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy