Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ugly, very ugly, incredibly ugly static linking of libsox on macOS #2951

Merged
merged 1 commit into from
Apr 29, 2020

Conversation

reuben
Copy link
Contributor

@reuben reuben commented Apr 28, 2020

All of the brew installed dependencies have static libraries as well, but the macOS linker will always prefer a dynamic library if both exist under the same -L/foo -lbar resolution. The only way to force static linking is to include a full path to the static library. These changes basically reverse engineer the static library locations and then pass those to the linker.

All of the brew installed dependencies have static libraries as well, but the macOS linker will always prefer a dynamic library if both exist under the same `-L/foo -lbar` resolution. The only way to force static linking is to include a full path to the static library. These changes basically reverse engineer the static library locations and then pass those to the linker.
@reuben
Copy link
Contributor Author

reuben commented Apr 28, 2020

All green. Dependencies from the macOS client now:

$ otool -L deepspeech
deepspeech:
	@rpath/libdeepspeech.so (compatibility version 0.0.0, current version 0.0.0)
	/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)

@reuben reuben merged commit 09b756a into master Apr 29, 2020
@reuben reuben deleted the hack-mac-sox-static branch April 29, 2020 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants