Segfault-Inc / Multicorn

Data Access Library
https://multicorn.org/
PostgreSQL License
700 stars 145 forks source link

Specify link flags required on OS X #93

Closed rtkrruvinskiy closed 9 years ago

rtkrruvinskiy commented 9 years ago

There a couple of issues with the link flags specified in PGXS for OS X, which this commit works around:

  1. -undefined dynamic_lookup is needed for the linker not to require that all symbols be resolved at link time.
  2. -bundle_loader is needed to have the symbols in the postgres binary take precedence over symbols with the same name defined elsewhere during runtime resolution. In particular, a function named hash_create is also defined in libsystem_c.dylib, and that function was being called without -bundle_loader specified.

Tested on OS X 10.10.2 with clang-600.0.56. Fixes #88. Fixes #90.

rdunklau commented 9 years ago

I don't have an OSX machine to test this on, so I'll just trust you on this one and merge it.

Thank you very much for this change !

rtkrruvinskiy commented 9 years ago

@rdunklau It would be nice to actually submit a fix for this to PGXS, since it doesn't just affect Multicorn. However, I'm a little unsure as to how to go about this. Do you happen to know if the process described at https://wiki.postgresql.org/wiki/Submitting_a_Patch applies to PGXS, as well? Thanks!

rdunklau commented 9 years ago

Yes, it does: PGXS is part of PostgreSQL. I don't have sufficient knowledge in the build system to know whether or not your patch will make sense on a global basis, or if we did something wrong in Multicorn to warrant your changes. So, feel free to start the discussion on pgsql-hackers ! :)