[issue34960] macOS builds expose stack_size option in LINKEDFOORSHARED and pyconfig

2018-10-11 Thread Simon Wells


Simon Wells  added the comment:

oh the rabbit hole...

as i have other builds of python3.7 on my system i wanted to ensure it used the 
correct python and python-config (python 3.7 was built and installed into 
$HOME/Projects/python/inst/) as such its a rather convoluted configure command 
for libxml2

LDFLAGS="-L$HOME/Projects/python/inst/lib" 
PATH=/Users/simon/Projects/python/inst/bin/:$PATH ./configure 
--prefix=/Users/simon/Projects/python/inst/ 
--with-python=/Users/simon/Projects/python/inst/bin/python3 
--with-python-install-dir=/Users/simon/Projects/python/inst/lib/python3.7/site-packages

the LDFLAGS envvar was required as python-config --ldflags also does not 
provide -L for the python libary

$make
ld: library not found for -lpython3.7m

in config.log for libxml2 (PYTHON_LIBS which is the output of 
$HOME/Projects/python/python3-config --ldflags)
PYTHON_LIBS='-lpython3.7m -ldl -framework CoreFoundation 
-Wl,-stack_size,100 -framework CoreFoundation'


after LDFLAGS="..." is added

$make
...
  CCLD libxml2mod.la
ld: -stack_size option can only be used when linking a main executable
clang: error: linker command failed with exit code 1 (use -v to see invocation)

if you want more log lines please let me know but those should be the only 
relevant ones

--

___
Python tracker 
<https://bugs.python.org/issue34960>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34960] python-config bad ldflags on macOS

2018-10-11 Thread Simon Wells


Simon Wells  added the comment:

ah ok, sorry i wasn't clear at first, the issue isn't when building python its 
when building a library which depends on python in this case libxml2, which 
when given the --enable-python stuff uses 
"PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags`" and therefore is being 
given the -Wl,stack_size linker option which is not valid for non main 
executables according to the error produced from clang

--

___
Python tracker 
<https://bugs.python.org/issue34960>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34960] python-config bad ldflags on macOS

2018-10-11 Thread Simon Wells


Simon Wells  added the comment:

with a fresh 3.7.0 download

./configure --prefix=... --enable-shared
make -j5
make install

path/to/python3-config --ldflags
-lpython3.7m -ldl -framework CoreFoundation -Wl,-stack_size,100 -framework 
CoreFoundation

--

___
Python tracker 
<https://bugs.python.org/issue34960>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34960] python-config bad ldflags on macOS

2018-10-11 Thread Simon Wells


New submission from Simon Wells :

if you didn't build python as a framework it adds 
sysconfig.get_config_vars('LINKFORSHARED') when you run 'python-config 
--ldflags' this resolves to

>>> sysconfig.get_config_var('LINKFORSHARED')
'-Wl,-stack_size,100  -framework CoreFoundation 
/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/Python'

the '-Wl,-stack_size' ldflag causes issues for clang with the error

"ld: -stack_size option can only be used when linking a main executable"

--
components: macOS
messages: 327545
nosy: ned.deily, ronaldoussoren, xzcvczx
priority: normal
severity: normal
status: open
title: python-config bad ldflags on macOS
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 
<https://bugs.python.org/issue34960>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com