pilotmoon / Scroll-Reverser

Per-device scrolling prefs on macOS.
https://pilotmoon.com/scrollreverser/
Apache License 2.0
2.71k stars 139 forks source link

Scroll Reverser 1.5.1 crashes on Intel Mac OS X Tiger 10.4.11 #77

Open ryandesign opened 4 years ago

ryandesign commented 4 years ago

Hi, your web site says Scroll Reverser 1.5.1 should work on Mac OS X Tiger 10.4, but on my Intel Mac it crashes on launch:

**********

Host Name:      MacBookPro2
Date/Time:      2020-01-29 14:30:35.632 -0600
OS Version:     10.4.11 (Build 8S2167)
Report Version: 4

Command: Scroll Reverser
Path:    /Applications/Scroll Reverser.app/Contents/MacOS/Scroll Reverser
Parent:  WindowServer [56]

Version: 1.5.1 (65)

PID:    213
Thread: Unknown

Link (dyld) error:

Symbol not found: _kLSSharedFileListItemBeforeFirst
  Referenced from: /Applications/Scroll Reverser.app/Contents/MacOS/Scroll Reverser
  Expected in: /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices

Apple documentation says kLSSharedFileListItemBeforeFirst (used in LoginItemsController.m) was introduced in Mac OS X 10.5. I see that that code is not supposed to be compiled if TIGER_BUILD is defined. According to ScrollInverter.xcodeproj/project.pbxproj, TIGER_BUILD is only defined when sdk=macosx10.4. (It seems like it would be more correct to base this on the deployment target, not the SDK.) I see that in cb13c8da462476ded56798cf4f8dc73fce4ab64f the Xcode project was changed to use the 10.4 SDK and deployment target for PowerPC builds but the 10.6 SDK and 10.5 deployment target for Intel builds, which explains why the Intel part of the build doesn't work on 10.4.

If I use lipo to -thin the universal executable to just the ppc arch, it runs fine on Intel Mac OS X 10.4 via Rosetta.

pilotmoon commented 4 years ago

Thanks. I think I only ever tested it on a PPC Mac, never intel Tiger. 9 years later you are the first to report the Intel bug :)

On 29 Jan 2020, at 23:48, Ryan Schmidt notifications@github.com wrote:

Hi, your web site says Scroll Reverser 1.5.1 should work on Mac OS X Tiger 10.4, but on my Intel Mac it crashes on launch:


Host Name: MacBookPro2 Date/Time: 2020-01-29 14:30:35.632 -0600 OS Version: 10.4.11 (Build 8S2167) Report Version: 4

Command: Scroll Reverser Path: /Applications/Scroll Reverser.app/Contents/MacOS/Scroll Reverser Parent: WindowServer [56]

Version: 1.5.1 (65)

PID: 213 Thread: Unknown

Link (dyld) error:

Symbol not found: _kLSSharedFileListItemBeforeFirst Referenced from: /Applications/Scroll Reverser.app/Contents/MacOS/Scroll Reverser Expected in: /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices Apple documentation says https://developer.apple.com/documentation/coreservices/klssharedfilelistitembeforefirst kLSSharedFileListItemBeforeFirst (used in LoginItemsController.m) was introduced in Mac OS X 10.5. I see that that code is not supposed to be compiled if TIGER_BUILD is defined. According to ScrollInverter.xcodeproj/project.pbxproj, TIGER_BUILD is only defined when sdk=macosx10.4. (It seems like it would be more correct to base this on the deployment target, not the SDK.) I see that in cb13c8d https://github.com/pilotmoon/Scroll-Reverser/commit/cb13c8da462476ded56798cf4f8dc73fce4ab64f the Xcode project was changed to use the 10.4 SDK and deployment target for PowerPC builds but the 10.6 SDK and 10.5 deployment target for Intel builds, which explains why the Intel part of the build doesn't work on 10.4.

If I use lipo to -thin the universal executable to just the ppc arch, it runs fine on Intel Mac OS X 10.4 via Rosetta https://en.wikipedia.org/wiki/Rosetta_(software).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pilotmoon/Scroll-Reverser/issues/77?email_source=notifications&email_token=AAAEI4BKD2WS5DUYPL6VM5DRAIIWRA5CNFSM4KNNM6V2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IJV7FPQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEI4B5BIOMMCMR3DOLAP3RAIIWRANCNFSM4KNNM6VQ.

pilotmoon commented 4 years ago

By the way is this a vintage machine, or are you installing Tiger on an intel Mac somehow? (I think Tiger on Intel only ever came factory installed on a new Mac, and install media was first produced for Leopard?)

ryandesign commented 4 years ago

Yeah unlike on PowerPC where it may be the last supported OS, there's not much reason to use Tiger on Intel Macs. But yes I restored a vintage MacBookPro2,2 back to its original Tiger OS for fun. Tiger doesn't run in virtualization on modern CPUs unless you patch its kernel, and since the Intel Tiger installers were all machine-specific you'd also have to patch the installer to change or remove the list of machines on which it is willing to install.

I wanted to at least document the problems with Scroll Reverser on Intel Tiger. It should be possible to fix the problem and recompile. I spent some time trying to do this with Xcode 2.5 on Tiger but ran into several problems. In addition to changing the SDK and deployment targets back to 10.4, I had to make changes to the build scripts which assume /usr/bin/git and /usr/libexec/PlistBuddy exist; they don't on Tiger (though PlistBuddy is left behind in several installer receipts, such as /Library/Receipts/AdditionalEssentials.pkg/Contents/Resources/PlistBuddy). And when I opened the Xcode project I was warned that it had been saved with a newer Xcode and some things might not work; indeed, the application it built was missing the MacOS folder and the executable inside. Rebuilding it on 10.6 (provided Xcode 3.2.6 has been installed with the optional the 10.4) should be easier but I haven't tried that yet.

pilotmoon commented 4 years ago

@ryandesign Did you discover the https://github.com/pilotmoon/Scroll-Reverser/tree/tiger branch? I haven't tried building it for years but it might just compile.

pilotmoon commented 4 years ago

Actually yes I guess looks like you did. IIRC the tiger build was done on Snow Leopard.

pilotmoon commented 3 years ago

While I remember. (Distant memories coming up.) That version of the app builds in two parts. Intel build uses the 10.6 SDK and assumes it's running on at least Leopard. This is why it crashes on Intel 10.4. PowerPC build had #defines in it to remove the calls that aren't supported on 10.4.

So to make it run on 10.4 Intel you would need to #define out the same bits that are excluded from the PowerPC build.

Thinking about it the whole thing is a bit of a hack conflating OS target and Processor target. I just assumed it would never run on an Intel machine running Tiger!