Skip to content

Apply -fPIC to CFLAGS for zstd#9

Merged
mhsmith merged 2 commits intobeeware:mainfrom
robertkirkman:i686-fpic
Apr 3, 2026
Merged

Apply -fPIC to CFLAGS for zstd#9
mhsmith merged 2 commits intobeeware:mainfrom
robertkirkman:i686-fpic

Conversation

@robertkirkman
Copy link
Copy Markdown
Contributor

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@freakboy3742
Copy link
Copy Markdown
Member

Thanks - based on what I understand of Android 32-bit compiles, this makes sense, and it seems fairly innocuous; I'll leave it to @mhsmith for a final review and merge.

@freakboy3742 freakboy3742 requested a review from mhsmith April 2, 2026 01:10
Copy link
Copy Markdown
Member

@mhsmith mhsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to do this in the zstd build script, in the same way as we already do for bzip2, for the following reasons:

  • The android-env.sh should remain identical to the copy in the cpython repository.
  • Many projects, including cpython itself, already add -fPIC to the command line, and having more than one copy of the argument makes it difficult to follow where it comes from.
  • It's possible that the argument will at some point be necessary on other architectures.

@robertkirkman
Copy link
Copy Markdown
Contributor Author

Thanks, I will revise this. Preexisting projects that use the argument place it in a variety of different places and don't always restrict it only to 32-bit x86 or only to zstd, so I was just guessing where it should go. I will change it to the place you requested.

@robertkirkman robertkirkman changed the title Apply -fPIC to builds for 32-bit x86 targets Apply -fPIC to CFLAGS for zstd Apr 2, 2026
@robertkirkman robertkirkman changed the title Apply -fPIC to CFLAGS for zstd Apply -fPIC to CFLAGS for zstd Apr 2, 2026
@robertkirkman robertkirkman marked this pull request as ready for review April 2, 2026 22:30
Copy link
Copy Markdown
Member

@mhsmith mhsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mhsmith mhsmith merged commit f4c94a0 into beeware:main Apr 3, 2026
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.

32-bit x86 zstd static library is built without -fPIC, causing error: relocation R_386_PC32

3 participants