Skip to content
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

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

Closed
wants to merge 1 commit into from

Conversation

brettcannon
Copy link
Member

@brettcannon brettcannon commented Oct 22, 2021

@@ -172,7 +172,7 @@ time timemodule.c
#audioop audioop.c
#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
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.

Copy link
Member Author

@brettcannon brettcannon Oct 22, 2021

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
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
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
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