Skip to content

Fix build errors of in-tree build#182

Open
bigplaice wants to merge 1 commit into
ossc-db:masterfrom
bigplaice:master
Open

Fix build errors of in-tree build#182
bigplaice wants to merge 1 commit into
ossc-db:masterfrom
bigplaice:master

Conversation

@bigplaice

@bigplaice bigplaice commented May 25, 2026

Copy link
Copy Markdown

When build pg_bulkload in contrib directory of PG source code, there are building errors:
make[1]: --pkglibdir: No such file or directory
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O0 -g pg_bulkload.o recovery.o pgut/pgut.o pgut/pgut-fe.o pgut/pgut-list.o -L../../../src/port -L../../../src/common -Wl,-rpath,'$ORIGIN/../lib:$ORIGIN/..' -Wl,--as-needed -Wl,--build-id -L../../../src/interfaces/libpq -lpq -L -lpgcommon -lpgport -lpam -lssl -lcrypto -lz -ledit -lm -o pg_bulkload
/usr/bin/ld: pgut/pgut.o: in function pgut_init': /home/highgo/tmp/postgresql-18.3/contrib/pg_bulkload-VERSION3_1_23/bin/pgut/pgut.c:79:(.text+0x4a): undefined reference to set_pglocale_pgservice'
/usr/bin/ld: pgut/pgut.o: in function prompt_for_password': /home/highgo/tmp/postgresql-18.3/contrib/pg_bulkload-VERSION3_1_23/bin/pgut/pgut.c:395:(.text+0x8ce): undefined reference to simple_prompt'
/usr/bin/ld: pgut/pgut-list.o: in function new_list': /home/highgo/tmp/postgresql-18.3/contrib/pg_bulkload-VERSION3_1_23/bin/pgut/pgut-list.c:114:(.text+0x1eb): undefined reference to palloc'
/usr/bin/ld: pgut/pgut-list.o: in function enlarge_list': /home/highgo/tmp/postgresql-18.3/contrib/pg_bulkload-VERSION3_1_23/bin/pgut/pgut-list.c:174:(.text+0x2f9): undefined reference to repalloc'
/usr/bin/ld: pgut/pgut-list.o: in function list_free_private': /home/highgo/tmp/postgresql-18.3/contrib/pg_bulkload-VERSION3_1_23/bin/pgut/pgut-list.c:1565:(.text+0x2bf9): undefined reference to pfree'
/usr/bin/ld: /home/highgo/tmp/postgresql-18.3/contrib/pg_bulkload-VERSION3_1_23/bin/pgut/pgut-list.c:1568:(.text+0x2c2e): undefined reference to pfree' /usr/bin/ld: /home/highgo/tmp/postgresql-18.3/contrib/pg_bulkload-VERSION3_1_23/bin/pgut/pgut-list.c:1569:(.text+0x2c3a): undefined reference to pfree'

This is caused by the change introduced by ticket #97. On my Ubuntu platform(24.04.1 LTS), it will cause build errors.
As both "pg_config --libdir" and "pg_config --pkglibdir" in new Ubuntu get same result, the workaround of ticket #97 is not necessary now.

When build pg_bulkload in contrib directory of PG source code, there are building errors:
make[1]: --pkglibdir: No such file or directory
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O0 -g pg_bulkload.o recovery.o pgut/pgut.o pgut/pgut-fe.o pgut/pgut-list.o  -L../../../src/port -L../../../src/common -Wl,-rpath,'$ORIGIN/../lib:$ORIGIN/..'  -Wl,--as-needed -Wl,--build-id  -L../../../src/interfaces/libpq -lpq -L -lpgcommon -lpgport -lpam -lssl -lcrypto -lz -ledit -lm -o pg_bulkload
/usr/bin/ld: pgut/pgut.o: in function `pgut_init':
/home/highgo/tmp/postgresql-18.3/contrib/pg_bulkload-VERSION3_1_23/bin/pgut/pgut.c:79:(.text+0x4a): undefined reference to `set_pglocale_pgservice'
/usr/bin/ld: pgut/pgut.o: in function `prompt_for_password':
/home/highgo/tmp/postgresql-18.3/contrib/pg_bulkload-VERSION3_1_23/bin/pgut/pgut.c:395:(.text+0x8ce): undefined reference to `simple_prompt'
/usr/bin/ld: pgut/pgut-list.o: in function `new_list':
/home/highgo/tmp/postgresql-18.3/contrib/pg_bulkload-VERSION3_1_23/bin/pgut/pgut-list.c:114:(.text+0x1eb): undefined reference to `palloc'
/usr/bin/ld: pgut/pgut-list.o: in function `enlarge_list':
/home/highgo/tmp/postgresql-18.3/contrib/pg_bulkload-VERSION3_1_23/bin/pgut/pgut-list.c:174:(.text+0x2f9): undefined reference to `repalloc'
/usr/bin/ld: pgut/pgut-list.o: in function `list_free_private':
/home/highgo/tmp/postgresql-18.3/contrib/pg_bulkload-VERSION3_1_23/bin/pgut/pgut-list.c:1565:(.text+0x2bf9): undefined reference to `pfree'
/usr/bin/ld: /home/highgo/tmp/postgresql-18.3/contrib/pg_bulkload-VERSION3_1_23/bin/pgut/pgut-list.c:1568:(.text+0x2c2e): undefined reference to `pfree'
/usr/bin/ld: /home/highgo/tmp/postgresql-18.3/contrib/pg_bulkload-VERSION3_1_23/bin/pgut/pgut-list.c:1569:(.text+0x2c3a): undefined reference to `pfree'

This is caused by the change introduced by ticket ossc-db#97.
On my Ubuntu platform(24.04.1 LTS), it will cause build errors.
As both "pg_config --libdir" and "pg_config --pkglibdir" in new Ubuntu get same result, the workaround of ticket ossc-db#97 is not necessary.
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

Successfully merging this pull request may close these issues.

1 participant