Bug 240851 - lang/python??: Fails to link with PIE (ld: error: relocation R_X86_64_PC32 cannot be used against symbol *)
Summary: lang/python??: Fails to link with PIE (ld: error: relocation R_X86_64_PC32 ca...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-python (Nobody)
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2019-09-27 01:50 UTC by Miyashita Touka
Modified: 2019-09-27 04:37 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (python)


Attachments
27 build log (458.94 KB, text/plain)
2019-09-27 01:50 UTC, Miyashita Touka
no flags Details
36 build log (953.69 KB, text/plain)
2019-09-27 01:50 UTC, Miyashita Touka
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miyashita Touka 2019-09-27 01:50:12 UTC
Created attachment 207866 [details]
27 build log

The python 2/3 ports fail in the package/stage make targets with the following errors on 12-STABLE amd64:

(for 27)
Compiling /wrkdirs/usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/zipfile.py ...
*** Error code 1

(for 36)
pkg-static: Unable to access file /wrkdirs/usr/ports/lang/python36/work/stage/usr/local/lib/python3.6/test/test_json/__pycache__/test_unicode.cpython-36.pyc:No such file or directory
*** Error code 1

To reproduce:
1) enable WITH_PIE=yes in src.conf and rebuild (if it's not default)
2) set kern.elf64.aslr.enable and kern.elf64.aslr.pie_enable sysctls to 1
3) add the following to make.conf:
CFLAGS+= -fPIE
CXXFLAGS+= -fPIE
LDFLAGS+= -pie
4) build the ports

They may just need a simple tweak.
Comment 1 Miyashita Touka 2019-09-27 01:50:35 UTC
Created attachment 207867 [details]
36 build log