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

link failure: pointer not aligned at _kWhence+0x4 (macOS 14.4) #166

Open
quantimnot opened this issue Mar 7, 2024 · 2 comments
Open

link failure: pointer not aligned at _kWhence+0x4 (macOS 14.4) #166

quantimnot opened this issue Mar 7, 2024 · 2 comments

Comments

@quantimnot
Copy link

Error

ld: building fixups: pointer not aligned at _kWhence+0x4 from o//blink/blink.a[124](strace.o)

Failing Build Command

./configure && gmake -j

Relevant Source

#ifndef thatispacked
#define thatispacked __attribute__((__packed__))
#endif
struct thatispacked MagicNumber {
  int x;
  const char *s;
};
const struct MagicNumber kWhence[] = {
    {SEEK_SET_LINUX, "SEEK_SET"},  //
    {SEEK_CUR_LINUX, "SEEK_CUR"},  //
    {SEEK_END_LINUX, "SEEK_END"},  //
};

Resolution

Disable packing: CPPFLAGS="-Dthatispacked="

{ ./configure CPPFLAGS="-Dthatispacked=" && gmake -j; } >o/build.stdout 2>o/build.stderr && gmake -j check >o/check.stdout 2>o/check.stderr

PASSED (323 / 323 tests (1 skipped))

Versions

uname -v

Darwin Kernel Version 23.4.0: Wed Feb 21 21:51:37 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T8112

pkgutil --pkg-info com.apple.pkg.CLTools_Executables

package-id: com.apple.pkg.CLTools_Executables
version: 15.3.0.0.1.1708646388
volume: /
location: /
install-time: 1709746099

"$(xcode-select -p)/usr/bin/cc" -v

Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

"$(xcode-select -p)/usr/bin/ld" -v

@(#)PROGRAM:ld PROJECT:ld-1053.12
BUILD 19:09:13 Feb 1 2024
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
will use ld-classic for: armv6 armv7 armv7s arm64_32 i386 armv6m armv7k armv7m armv7em LTO support using: LLVM version 15.0.0 (static support for 29, runtime is 29)
TAPI support using: Apple TAPI version 15.0.0 (tapi-1500.3.2.2)

"$(xcode-select -p)/usr/bin/ld-classic" -v

@(#)PROGRAM:ld-classic PROJECT:ld64-951.9
BUILD 20:36:32 Jan 26 2024
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
LTO support using: LLVM version 15.0.0 (static support for 29, runtime is 29)
TAPI support using: Apple TAPI version 15.0.0 (tapi-1500.3.2.2)

References

@espinielli
Copy link

espinielli commented Apr 27, 2024

This worked for me to compile and pass tests. Thanks!
BUT when I tried to use it as

$ blinkenlights -rt sectorlisp-friendly.bin

it dumped

@chenrui333
Copy link

seeing the same issue while building on macos 15, any update on this thread?

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

No branches or pull requests

3 participants