Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-45548: Have Modules/Setup only try to compile _math once#29177

Closed
brettcannon wants to merge 1 commit into
python:mainpython/cpython:mainfrom
brettcannon:fix-math-setupbrettcannon/cpython:fix-math-setupCopy head branch name to clipboard
Closed

bpo-45548: Have Modules/Setup only try to compile _math once#29177
brettcannon wants to merge 1 commit into
python:mainpython/cpython:mainfrom
brettcannon:fix-math-setupbrettcannon/cpython:fix-math-setupCopy head branch name to clipboard

Conversation

@brettcannon

@brettcannon brettcannon commented Oct 22, 2021

Copy link
Copy Markdown
Member

Comment thread Modules/Setup
#binascii binascii.c
#cmath cmathmodule.c _math.c # -lm
#math mathmodule.c _math.c # -lm
#math mathmodule.c # _math.c # -lm # Only one of cmath/math needs to compile _math.c

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think that will work with *shared** mode.

@brettcannon brettcannon Oct 22, 2021

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You're right.

/usr/bin/ld: Modules/cmathmodule.o: relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC`

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Your idea of making the functions static might actually be necessary to solve this. Not sure how _math.h influences anything as I haven't looked to see if it's included anywhere else.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The relocation R_X86_64_32 against `.data' issue is a different problem. You are trying to use an .o file from a static build in a shared module. You must make clean every time you modify Modules/Setup. ccache helps a lot here.

@brettcannon

Copy link
Copy Markdown
Member Author

All of this was taken care of in #29179.

@brettcannon brettcannon deleted the fix-math-setup branch October 25, 2021 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.