Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

ffmpeg-0.9 build fails on 10.5 #9312

Closed
alekq opened this issue Dec 28, 2011 · 9 comments
Closed

ffmpeg-0.9 build fails on 10.5 #9312

alekq opened this issue Dec 28, 2011 · 9 comments

Comments

@alekq
Copy link

alekq commented Dec 28, 2011

https://gist.github.com/1528236 "brew install -v ffmpeg" output.

https://gist.github.com/1528246 "brew doctor" output.

Ffmpeg build failed on upgrade to 0.9 and clean install, also.

Found out that this is known problem when using gcc >= 4.2 and PIC on 32-bit x86. Adding "--extra-cflags=-mdynamic-no-pic" to ffmpeg formula finally made build possible.

This is my first bug report, so be gentle. :P

Alex

@mistydemeo
Copy link
Member

It looks like that workaround was being applied, but only on Snow Leopard for some reason. Leopard was clearly broken too. Fixed in 09d5b0e. Thanks for the report!

@alekq
Copy link
Author

alekq commented Dec 29, 2011

Actually, build fails again with the same error. I'm absolute beginner with programming in Ruby, so can't provide you with more concrete information. However, I noticed this:

  1. when build fails it reports this at the end:

Hardware: dual-core 64-bit penryn
OS X: 10.5.8
Kernel Architecture: i386

I'm not sure how "Hardware" (class?) in ffmpeg.rb works, however Homebrew reports hardware as 64-bit and arch as 32-bit. I don't know is there any way to modify FFmpeg formula to test for arch, not hardware. ** Sorry in advance if I'm writing nonsense. **

  1. I modified my local ffmpeg.rb like this and now it works again:

if MacOS.leopard? and Hardware.is_64_bit?
ENV.append_to_cflags "-mdynamic-no-pic"
end

@alekq
Copy link
Author

alekq commented Jan 3, 2012

Any progress in solving this issue? Problem is still present.

Thank you.

Alex

@adamv adamv reopened this Jan 3, 2012
@mistydemeo
Copy link
Member

Sorry about that.

I don't have a Leopard computer to test with, but it sounds like the problem is that ffmpeg is detecting your processor as 32-bit. On older OS X's, kernel arch and processor arch are separate, and you may have a 32-bit kernel but be able to run 64-bit programs. In this case Homebrew's detecting your processor differently from how ffmpeg does, so Hardware.is_32_bit? isn't helping.

Can you tell me what happens if you replace that bit of code with the following?

if `uname -m`.chomp == 'i386'
  ENV.append_to_cflags "-mdynamic-no-pic"
end

@adamv
Copy link
Contributor

adamv commented Jan 3, 2012

Also note that Homebrew defaults to building everything 32-bit on Leopard, regardless of hardware.

@mistydemeo
Copy link
Member

Interesting, didn't realize that. In that case, if MacOS.leopard? or Hardware.is_32_bit? would probably be more appropriate.

@alekq
Copy link
Author

alekq commented Jan 4, 2012

if MacOS.leopard? or Hardware.is_32_bit?

Worked like a charm. :) FFmpeg now builds without any problems.

Thank you.

Alex

@alekq alekq closed this as completed Jan 4, 2012
@adamv adamv reopened this Jan 4, 2012
@adamv
Copy link
Contributor

adamv commented Jan 4, 2012

Reopening until the formula is patched.

@mistydemeo
Copy link
Member

Fixed - thanks!

wesen pushed a commit to wesen/homebrew that referenced this issue Jan 8, 2012
Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Sep 12, 2012
snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants