Opened 11 years ago

Last modified 11 years ago

#2134 new defect

Build fails with clang, lvvm, etc. on Mac OSX > 10.6 (fix included)

Reported by: git@… Owned by: diego@…
Priority: normal Component: build system
Version: HEAD Severity: critical
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description

It is not possible to build Mplayer on Mac OS X > 10.6 due to a few errors in the build system. The following changes (all can be implemented in configure for the darwin/x86_64 target) allow mplayer to build properly.

  1. using -DPIC with YASM to allow ffmpeg to compile properly
  2. Using -Wl,-pie to fix linking since -pie -fpie is incorrect under Darwin's clang
  3. --mdynamic-no-pic breaks compilation due to security features in newer versions of Mac OS X

Clang does support PIC but the configure check breaks due to the inclusion of -fpie -pie so I added a separate check for clang and darwin to include the right flags. After that, PIC is successfully detected and works fine.

Attached a patch which fixes the issue and should not affect any other platforms.

Attachments (2)

mplayer-clang-fix.diff (1.1 KB ) - added by git@… 11 years ago.
Darwin-specific changes to fix compilation on current Mac OS X/Xcode/clang
mplayer-clang-fix.2.diff (740 bytes ) - added by git@… 11 years ago.
Darwin-specific changes to fix compilation on current Mac OS X/Xcode/clang

Download all attachments as: .zip

Change History (4)

by git@…, 11 years ago

Attachment: mplayer-clang-fix.diff added

Darwin-specific changes to fix compilation on current Mac OS X/Xcode/clang

by git@…, 11 years ago

Attachment: mplayer-clang-fix.2.diff added

Darwin-specific changes to fix compilation on current Mac OS X/Xcode/clang

comment:1 by git@…, 11 years ago

attachments.isobsolete: 01

Updated the patch to remove an extraneous change. This patch only touches the relevant areas now.

comment:2 by git@…, 11 years ago

Summary: Build fails with clang, lvvm, etc. on Mac OSX > 10.6Build fails with clang, lvvm, etc. on Mac OSX > 10.6 (fix included)
Note: See TracTickets for help on using tickets.