Mac OS X El Capitan 可以运行为 Yosemite 编译且需要 /usr/gnu64/lib 中的库的软件吗?

2024-04-30

Sorry, there's a bit of background necessary — you could try skipping to the Question heading.

自远古以来(无论如何,在上个千年的某个时候),我创建了诸如/usr/gnu and /usr/gcc保存自定义编译的 GNU 软件,与系统目录中的任何内容分开。这对我来说效果很好,适用于各种基于 Unix 的系统,包括 2002 年以来的 Mac OS X(Jaguar,10.2)。 (不使用的原因之一/usr/local问题是 IT 管理层维护了它,而且它总是包含过时的代码——例如,直到大约 5 年前,Perl 4 才可用。使用其他名称可以避免与他们发生冲突。)

在 Mac OS X 10.11 El Capitan 中,Apple 引入了 SIP(​​系统完整性保护)系统(参见El Capitan 的“无根”功能到底是什么? https://apple.stackexchange.com/questions/193368/what-is-the-rootless-feature-in-el-capitan-really关于“询问不同”)。这意味着我无法再创建诸如/usr/gnu or /usr/gcc,尽管它们与苹果拥有的任何东西都脱节。

我发现以前在这些目录中的软件已被隔离在这样的目录中(其中 UUID 在您的计算机上会有所不同,我可能有两个,因为将 El Capitan 放到这台计算机上是一个多步骤的操作 - 一个单独的长期和无聊的故事):

$ ls -1 /Library/SystemMigration/History/
Migration-7D74B534-AA54-4A4A-8DCC-A5C2F28E1A39
Migration-9C0FE7A4-3445-4BD6-A512-35464EECCBC3
$

然后在子目录下QuarantineRoot:

$ ls /Library/SystemMigration/History/Migration-9C0FE7A4-3445-4BD6-A512-35464EECCBC3/QuarantineRoot/usr:
gcc      gnu32    gnu64
$

然而,二进制文件是用 GCC 和各种库编译的,因此它们目前无法运行。例如:

$ otool -L bison
bison:
    /usr/gnu64/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.1.0)
    /usr/gnu64/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.1.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.18.0)
    /usr/gcc/v4.7.1/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
$ ./bison
dyld: Library not loaded: /usr/gnu64/lib/libintl.8.dylib
  Referenced from: /Library/SystemMigration/History/Migration-9C0FE7A4-3445-4BD6-A512-35464EECCBC3/QuarantineRoot/usr/gnu64/bin/./bison
  Reason: image not found
Trace/BPT trap: 5
$

AFAIK,我什至无法创建符号链接/usr这样gcc or gnu64指向其他地方(甚至不以 root 权限运行)。这是我用来在 MachineA 上创建软件的技术之一,其中有空闲空间/work1用于另一台有空闲空间的机器/work5;中的符号链接/usr允许代码位于/work1/gcc or /work5/gcc只要它就可以正常工作/usr/gcc指向文件实际安装的位置。因此,这个 SIP 系统似乎杀死了几十年来成功使用的所有机制,这些机制的前提是能够在其中创建至少某种类型的目录条目。/usr.

Question

  • 有没有一种明智的方法可以让旧的二进制文件运行without禁用 SIP 并且无需立即重新编译所有内容?

后备位置是“重新编译软件——避免/usr作为安装位置”。随着时间的推移,我计划使用/opt/gcc and /opt/gnu64而不是下的等价物/usr。我什至正在考虑使用我的主目录下的空间,尽管我不愿意;它是“系统”软件。

不过,我已经编译了相当多的软件,包括多个版本的GCC(从4.4.2到5.2.0),重新编译会很麻烦。事实上,我将不得不放弃旧版本的 GCC,我不经常使用它,但当我确实需要它们时它们很有用。


Oh, and I've got a problem with the configure script for GNU Tar (1.28 and 1.26). It tests how deep a directory tree it can create, and then is unable to clean-up. And neither rm nor rmdir can clean up either, even if I cd down the hierarchy to the bottom. It gets an 'out of disk space' error, even though there's lots of space left. I can use Finder to move the hierarchy to Trash. But Finder can't remove them either. Bash has a tizzy because it can't work out what the current directory is. It is all kinda painful! So recompiling and reinstalling some of the software is not going to be trivial. I may even end up using stuff compiled by other people (MacPorts, HomeBrew, etc), but I like to be able to compile my own. I get the error 'The operation can’t be completed because the item “confdir-14B---” is in use'; a reboot may be in order, but I'm not confident it will fix that problem.


只是为了关闭:

  • 不;似乎没有办法避免重新编译代码。

如果您想点击聊天链接,请务必这样做,但最终会得到相同的结论。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Mac OS X El Capitan 可以运行为 Yosemite 编译且需要 /usr/gnu64/lib 中的库的软件吗? 的相关文章

随机推荐