vere icon indicating copy to clipboard operation
vere copied to clipboard

potentially incorrect decl/def of global `_u3o_Config` variable

Open matthew-levan opened this issue 2 years ago • 1 comments

@joemfb pointed my attention back at L25 of pkg/noun/BUILD.bazel, which uses the -force_load option on macos to resolve a linker error that otherwise occurs during build.[^1]

We shouldn't have to force link our pkg/noun build, so we need to determine what the root cause is for this issue, why it only occurs (or seems to occur?) on macos, and implement a solution to fix it.

[^1]:

Undefined symbols for architecture arm64:
  "_u3o_Config", referenced from:
      _main in main.o
      __cw_utils in main.o
      __cw_serf_writ in main.o
      __king_dawn in libvere.a(king.o)
      _u3_king_commence in libvere.a(king.o)
      __serf_grab in libvere.a(serf.o)
      _u3_serf_work in libvere.a(serf.o)
      ...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Originally posted by @matthew-levan in https://github.com/urbit/vere/issues/157#issuecomment-1428948337

matthew-levan avatar Feb 14 '23 20:02 matthew-levan

If I explicitly initialize u3o_Config in noun/options.c (u3o_config u3o_Config = {};), I'm able to remove the -force_load on macos-aarch64. No idea why.

joemfb avatar Feb 14 '23 20:02 joemfb