We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4322

Summary: Build error for 2.0.9 snapshot on mojave 10.14
Product: SDL Reporter: haxpor
Component: buildAssignee: Sam Lantinga <slouken>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: blocker    
Priority: P2 CC: icculus
Version: 2.0.9   
Hardware: x86_64   
OS: Other   

Description haxpor 2018-10-17 18:30:21 UTC
Follow along with the normal build flow with
- ./configure
- make

(previuosly compiled and built for 2.0.8 official stable is fine)

then it shows error as follows

LTLINK build/libSDL2.la
/opt/local/bin/ranlib: object: build/.libs/libSDL2.a(SDL.o) malformed object (unknown load command 1)
ar: internal ranlib command failed
make: *** [build/libSDL2.la] Error 1

full log can be seen at this gist https://gist.github.com/haxpor/8493a87a14dfcc56f20b35e5938fc77f
Comment 1 haxpor 2018-10-17 19:43:04 UTC
FYI: build against xcode Version 10.0 (10A255)
Comment 2 Ryan C. Gordon 2018-10-17 20:52:14 UTC
This doesn't happen here; is there anything strange about how you ran configure, or something wild like it found Xcode 10's compiler but Xcode 9's linker?

--ryan.
Comment 3 Ryan C. Gordon 2018-10-17 20:53:06 UTC
("make V=1" will show the full command lines of all things make runs.)

--ryan.
Comment 4 Ryan C. Gordon 2018-10-17 20:54:03 UTC
(In reply to Ryan C. Gordon from comment #3)
> ("make V=1" will show the full command lines of all things make runs.)
> 
> --ryan.


Sorry for the spam: it's clear what the problem is:

/opt/local/bin/ranlib is not Xcode 10's copy of ranlib.

--ryan.
Comment 5 haxpor 2018-10-18 02:51:05 UTC
Thank you Ryan for fast reply!

You're completely right. It's about different copy of ranlib (and others too as I inspected in config.log).

The problem is due to Macport automatically injected setting PATH variable in my bash_profile long ago. After remove it, configure script can properly detect the right tools, and build successfully now.

Thanks again.