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

Compile fails on Darwin8 with --with-cxx=g++ #41999

Closed
rzigweid mannequin opened this issue May 20, 2005 · 6 comments
Closed

Compile fails on Darwin8 with --with-cxx=g++ #41999

rzigweid mannequin opened this issue May 20, 2005 · 6 comments
Labels
build The build process and cross-build

Comments

@rzigweid
Copy link
Mannequin

rzigweid mannequin commented May 20, 2005

BPO 1205568
Nosy @loewis, @devdanzin

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2010-08-21.14:38:02.882>
created_at = <Date 2005-05-20.11:05:21.000>
labels = ['build']
title = 'Compile fails on Darwin8 with --with-cxx=g++'
updated_at = <Date 2010-08-21.14:38:02.880>
user = 'https://bugs.python.org/rzigweid'

bugs.python.org fields:

activity = <Date 2010-08-21.14:38:02.880>
actor = 'BreamoreBoy'
assignee = 'none'
closed = True
closed_date = <Date 2010-08-21.14:38:02.882>
closer = 'BreamoreBoy'
components = ['Build']
creation = <Date 2005-05-20.11:05:21.000>
creator = 'rzigweid'
dependencies = []
files = []
hgrepos = []
issue_num = 1205568
keywords = []
message_count = 6.0
messages = ['60737', '60738', '60739', '60740', '82204', '114497']
nosy_count = 4.0
nosy_names = ['loewis', 'rzigweid', 'ajaksu2', 'BreamoreBoy']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'test needed'
status = 'closed'
superseder = None
type = 'compile error'
url = 'https://bugs.python.org/issue1205568'
versions = ['Python 2.6']

@rzigweid
Copy link
Mannequin Author

rzigweid mannequin commented May 20, 2005

As has been previously reported and fixed in some portions of the build
process, building on Darwin 8 with gcc-4.0 requires some extra libraries to
be passed.

When --with-cxx=g++ is specified to configure, and possibly for other flags
that make the build process be conscious of C++.

Tail of error:
gcc -u _PyMac_Error -o python.exe \
Modules/ccpython.o \
libpython2.4.a -ldl
/usr/bin/ld: Undefined symbols:
___gxx_personality_v0
collect2: ld returned 1 exit status
make: *** [python.exe] Error 1

Fix:
Add -lSystem and -lSystemStubs for Darwin 8 to the linker where
appropriate. I haven't identified all these spots though.

@rzigweid rzigweid mannequin added build The build process and cross-build labels May 20, 2005
@loewis
Copy link
Mannequin

loewis mannequin commented May 20, 2005

Logged In: YES
user_id=21627

Can you check whether just linking with g++ (instead of
linking with gcc, and still not adding -lSystem) also solves
the problem?

configure is supposed to detect that g++ is needed for
linking; if linking with g++ solves the problem, then
configure.in must be enhanced to properly auto-detect this case.

@rzigweid
Copy link
Mannequin Author

rzigweid mannequin commented Jun 3, 2005

Logged In: YES
user_id=554287

Firstly, exposing this bug, I discovred, also requires passing --with-
pydebug=true. It's fine if you don't compile with pydebug. I'm sorry I did not
mention/realize that initially.

Secondly in response to loewis comment. It looks like linking with g++ instead
of gcc as you eluded to takes care of the problem.

Ilyria% gcc -u _PyMac_Error -o python.exe \

            [Modules/ccpython.o](https://github.com/python/cpython/blob/main/Modules/ccpython.o) \\
            libpython2.4.a -ldl    

/usr/bin/ld: Undefined symbols:
___gxx_personality_v0
collect2: ld returned 1 exit status
Ilyria ~/src/Python-2.4.1 05-06-03 7:53AM
[gcc -u _PyMac_Error -o python.exe \\n Modules/ccpython.o \\n
libpython2.4.a -ldl ]
Ilyria% g++ -u _PyMac_Error -o python.exe \
Modules/ccpython.o \
libpython2.4.a -ldl
Ilyria ~/src/Python-2.4.1

@loewis
Copy link
Mannequin

loewis mannequin commented Jun 3, 2005

Logged In: YES
user_id=21627

Ok. configure should have detected that you need g++ to
link. To do so, it compiles the program

void foo();int main(){foo();}void foo(){}

with g++ (g++ -c), then links the object file with gcc. If
that fails, it concludes that g++ is needed.

Can you please
a) confirm that this specific procedure indeed links
correctly, and
b) experiment to find out what changes to the program need
to be made so that it fails to link because of
___gxx_personality_v0
?

To analyse b), a number of issues have to be considered: it
may be that more include files are needed in the test
program, it may be that other compiler flags need to be
passed, and it may be that more code needs to be added. If
you cannot easily make the test case fail, please try to
reduce Modules/ccpython so that moves towards the test code.

@devdanzin
Copy link
Mannequin

devdanzin mannequin commented Feb 16, 2009

Is this failure to build --with-pydebug a symptom of a real configure
issue?

@devdanzin devdanzin mannequin added the build The build process and cross-build label Feb 16, 2009
@BreamoreBoy
Copy link
Mannequin

BreamoreBoy mannequin commented Aug 21, 2010

No reply to msg60740.

@BreamoreBoy BreamoreBoy mannequin closed this as completed Aug 21, 2010
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build
Projects
None yet
Development

No branches or pull requests

0 participants