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

Add support for MacOS universal dylib for lzss library #399

Merged
merged 3 commits into from
May 20, 2024

Conversation

manchoz
Copy link
Contributor

@manchoz manchoz commented Dec 22, 2023

Add support for MacOS universal dylib for lzss library.

A new version of lzss.dylib has been generated in Universal (aka. fat) format: it now supports both x64 (Intel) and arm64 (Apple Silicon) Macs.

OBSOLETED. SEE BELOW

Steps to generate it:

$ clang lzss.c -o lzss.dylib -dynamiclib -std=gnu99 -fvisibility=hidden -fvisibility-inlines-hidden -arch arm64 -arch    x86_64 
$ strip -x lzss.dylib

Lipo Info

$ lipo -detailed_info lzss.dylib
Fat header in: lzss.dylib
fat_magic 0xcafebabe
nfat_arch 2
architecture x86_64
    cputype CPU_TYPE_X86_64
    cpusubtype CPU_SUBTYPE_X86_64_ALL
    capabilities 0x0
    offset 16384
    size 49560
    align 2^14 (16384)
architecture arm64
    cputype CPU_TYPE_ARM64
    cpusubtype CPU_SUBTYPE_ARM64_ALL
    capabilities 0x0
    offset 81920
    size 50104
    align 2^14 (16384)

@per1234 per1234 added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure labels Dec 22, 2023
@per1234 per1234 linked an issue Dec 22, 2023 that may be closed by this pull request
@manchoz manchoz marked this pull request as draft January 3, 2024 09:56
@manchoz manchoz force-pushed the macos_universal_lzss branch 2 times, most recently from 83afc5c to 3277067 Compare February 2, 2024 16:17
@CLAassistant
Copy link

CLAassistant commented Feb 2, 2024

CLA assistant check
All committers have signed the CLA.

@manchoz
Copy link
Contributor Author

manchoz commented Feb 2, 2024

Actual steps to generate it:

mv lzss.dylib lzss.dylib.x86_64
clang -std=c11 -Wall -Wextra -pedantic -c -fPIC lzss.c -o lzss.o
clang -shared lzss.o -o lzss.dylib.arm64
lipo -create lzss.dylib.x86_64 lzss.dylib.arm64 -o lzss.dylib

In the case of changes to lzss.c, we must compile the .o files for x86_64 and amd64 independently and then regenerate the .o and the .dylib from them.

@manchoz manchoz marked this pull request as ready for review February 2, 2024 16:42
@pennam pennam merged commit 4bb19b4 into arduino-libraries:master May 20, 2024
3 checks passed
@manchoz manchoz deleted the macos_universal_lzss branch May 20, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incompatible Lszz.py with Apple M1 processor
4 participants