Opened 12 years ago

Closed 12 years ago

#35629 closed defect (invalid)

clang-mp-* does not link crt1.o on 10.8 by default

Reported by: arsenm2@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc:
Port: clang-3.1

Description

$ clang-mp-3.1 arst.c Undefined symbols for architecture x86_64:

"start", referenced from:

-u command line option

ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

$ clang-mp-3.2 arst.c Undefined symbols for architecture x86_64:

"start", referenced from:

-u command line option

ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Works: clang-mp-3.1 arst.c /usr/lib/crt1.o clang-mp-3.1 arst.c -mmacosx-version-min=10.5 clang-mp-3.1 arst.c -mmacosx-version-min=10.6 clang-mp-3.1 arst.c -mmacosx-version-min=10.7

$ clang-mp-3.1 arst.c -mmacosx-version-min=10.8 Undefined symbols for architecture x86_64:

"start", referenced from:

-u command line option

ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Apple's clang does not have this problem: $ /usr/bin/clang arst.c Works

Change History (2)

comment:1 Changed 12 years ago by arsenm2@…

Formatting got kind of screwed up

Any of these work:

clang-mp-3.1 arst.c /usr/lib/crt1.o

clang-mp-3.1 arst.c -mmacosx-version-min=10.5

clang-mp-3.1 arst.c -mmacosx-version-min=10.6

clang-mp-3.1 arst.c -mmacosx-version-min=10.7

comment:2 Changed 12 years ago by Veence (Vincent)

Resolution: invalid
Status: newclosed

Normal. crt1.o has been obsoleted on 10.8 and replaced by a new linker directive to find the starting address: there is no need for a bootstrap anymore. ld64 provided with Macports is outdated and won’t link with this new convention. You need a newer ld (i.e. the version that goes with Xcode 4.4)

Note: See TracTickets for help on using tickets.