Michael Paquier <michael.paqu...@gmail.com> writes:
> Yes that would be indeed cleaner this way. I have poked a bit at that
> and finished with the attached that defines some rules to generate all
> the files needed. But actually it does not seem to be enough, for
> example on OSX this would fail to compile because it cannot find the
> postgres binary in src/backend/postgres. Does somebody have an idea
> what this is about? It seems that we have two problems here.

Yeah, on OS X, building regress.so (or any other loadable extension)
will fail unless you built the backend first:

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement 
-Wendif-labels -Wmissing-format-attribute -Wformat-security 
-fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -g -O2  -bundle 
-multiply_defined suppress -Wl,-undefined,dynamic_lookup -o regress.so  
regress.o -L../../../src/port -L../../../src/common -Wl,-dead_strip_dylibs   
-bundle_loader ../../../src/backend/postgres
ld: file not found: ../../../src/backend/postgres

The reason is you need the "-bundle_loader postgres" option, because
OS X's linker is pickier about unresolved symbols than Linux's.

However, that is not a 9.6 regression: that's never worked on OS X, or at
least not since we started using -bundle_loader.

I do not think that we want the makefiles to enforce this build
dependency, as that would completely destroy any speed advantage of trying
to build just the particular .so.  Maybe we could enforce the dependency
just on OS X, but since we haven't gotten complaints from people trying
to build like this on OS X, I doubt it's worth the trouble.

So my inclination is to fix the include-file issue and call it good.
In any case, if someone did want to deal with making the -bundle_loader
calls safer, it would be material for a separate patch IMO.

                        regards, tom lane

Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to