Re: Targeting older versions of macOS

Alexander Leidinger via Lame-dev <[email protected]> Thu, 14 May 2020 15:46:11 +0200
Newsgroups gmane.comp.audio.mp3.lame
Message-ID <20200514154611.Horde.4tUJTAq_y0UwkgbwpFv72kl@webmail.leidinger.net>
Quoting Al Fransham at Affective Sound via Lame-dev  
<[email protected]> (from Fri, 8 May 2020 06:45:41 +0000):

> I wonder if you can help. I wish to use Lame to mp3 encode audio on  
> macOS from El Capitan (10.11) forward. My development machine runs  
> Catalina (10.15).

As you haven't got a public reply from someone who knows something  
about MacOS, here an answer from someone who has never touched a Mac.

> I am new to Lame and to its associated build tools so I apologise if  
> any of this demonstrates an incorrect approach or should be obvious.
>
> On macOS Catalina, I built libmp3lame.a using the following:
>
> ./configure --disable-decoder --host="x86_64"
> make
> make install
>
> I linked to this from my program and this worked fine on Catalina  
> itself. I then tested my application on El Capitan and attempting to  
> call lame_init_params failed with the following error:
>
> dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwin
>   Referenced from: /Applications/MyApp.app/Contents/MacOS/MyApp
>   Expected in: /usr/lib/libSystem.B.dylib

This is a reference to something outside of LAME. I assume this is  
something which is owned/deliverd by Apple.

> So I built lame using the same configuration on El Capitan, then  
> linked the resultant libmp3lame.a and my program now works on both  
> Catalina and El Capitan. So far so good.
>
> I have two questions.
>
> Firstly, since I am able to successfully use libmp3lame.a on El  
> Capitan, is it reasonable to expect this to work fine for all  
> versions of macOS following El Capitan assuming an x86_64 CPU?

This depends upon the the guarantees Apples is giving or not giving in  
terms of userland ABI stability. If they garantee that an application  
build on version A also works on version A+B (for whatever values A or  
B may have, and there may be conditions to this), then yes. So this is  
not a question specific to LAME, but a question specific to MacOS, and  
is probably better asked in a MacOS specific development forum.

> Secondly, is it possible on Catalina (or other OS) to configure the  
> build in such a way that it works with earlier OSs, e.g. El Capitan  
> without having to build on the older OS itself?

In general this depends upon the build environment and if library  
versioning is used, and if the build environment is able to target  
specific symbol versions. So technically this is possible (like if you  
do development of smart phone applications where you can target API  
levels), but I have no idea if your or an ordinary MacOS development  
environment comes with this possibility by default. Again, this is  
more a question for a MacOS specific development forum.

Bye,
Alexander.

-- 
http://www.Leidinger.net [email protected]: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.org    [email protected]  : PGP 0x8F31830F9F2772BF