public inbox for [email protected]
help / color / mirror / Atom feed.bc files build dependency issues.
2+ messages / 2 participants
[nested] [flat]
* .bc files build dependency issues.
@ 2026-03-30 07:28 Anton A. Melnikov <[email protected]>
2026-03-30 12:39 ` Re: .bc files build dependency issues. Andres Freund <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Anton A. Melnikov @ 2026-03-30 07:28 UTC (permalink / raw)
To: pgsql-hackers
Hi!
While the original discussion was about a specific commit
ecaf7c5df and related fix in 16492df7 for 16+
and its effects [1], i would like to point out that
a similar behavior can be observed
on earlier stable branches (REL_14/15_STABLE) as well.
Using a pre-built source tree and the following reproduction
that is slightly modified version from [2] which suggests
that this is a known pattern for exposing the issue:
cd src/backend/parser
rm -rf .deps/ gram.c scan.c *.o *.bc gram.h
make parser.bc
result in:
$ make parser.bc
/usr/lib/llvm-16/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang
-no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-deprecated-non-prototype
-O2 -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -flto=thin -emit-llvm
-c -o parser.bc parser.c
In file included from parser.c:25:
../../../src/include/parser/gramparse.h:29:10: fatal error: 'parser/gram.h' file not found
#include "parser/gram.h"
^~~~~~~~~~~~~~~
1 error generated.
make: *** [../../../src/Makefile.global:1084: parser.bc] Error 1
Since this can be reproduced reliably on REL_14/15, it seems worth asking
whether fix for .bc files (or something equivalent) should also be
backpatched to lower branches, instead of only applying to newer ones.
Also as a possible improvement perhaps make the fix less strictly?
I.e. replace each .bc file's dependency on all .o files
with a more weak dependency just on all source .c files.
Namely use:
$(patsubst %.o,%.bc, $(OBJS)): $(patsubst %.o,%.c, $(OBJS))
instead of:
$(patsubst %.o,%.bc, $(OBJS)): $(OBJS)
This might still preserve correct build ordering while reducing
unnecessary coupling between targets. As a result make will
run faster during parallel builds since it won't wait
for absolutely all the object files to be created.
For example, rebuilding parser.bc would then require only
a single compiler call in src/backend/parser instead of many.
Please, see the attached bc-depends-on-c.txt and
bc-depends-on-o.txt for details.
Best regards,
--
Anton A. Melnikov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
[1] https://www.postgresql.org/message-id/flat/E1oYJbR-000FbR-LP%40gemulon.postgresql.org
[2] https://www.postgresql.org/message-id/20220915045007.zvlrqqicbttzpgi3%40awork3.anarazel.de
$ make parser.bc
'/usr/bin/perl' ./check_keywords.pl gram.y ../../../src/include/parser/kwlist.h
/usr/local/bin/bison -Wno-deprecated -d -o gram.c gram.y
/usr/local/bin/flex -b -CF -p -p -o'scan.c' scan.l
'/usr/bin/perl' ../../../src/tools/fix-old-flex-code.pl 'scan.c'
/usr/lib/llvm-16/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2 -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -flto=thin -emit-llvm -c -o parser.bc parser.c
$ ls
analyze.c gram.h Makefile parse_clause.c parse_cte.c parse_func.c parse_oper.c parser.c parse_type.c scan.c
check_keywords.pl gramparse.h meson.build parse_coerce.c parse_enr.c parse_merge.c parse_param.c parse_relation.c parse_utilcmd.c scan.l
gram.c gram.y parse_agg.c parse_collate.c parse_expr.c parse_node.c parser.bc parse_target.c README scansup.c
$ make parser.bc
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o analyze.o analyze.c
'/usr/bin/perl' ./check_keywords.pl gram.y ../../../src/include/parser/kwlist.h
/usr/local/bin/bison -Wno-deprecated -d -o gram.c gram.y
touch gram.h
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o gram.o gram.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_agg.o parse_agg.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_clause.o parse_clause.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_coerce.o parse_coerce.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_collate.o parse_collate.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_cte.o parse_cte.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_enr.o parse_enr.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_expr.o parse_expr.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_func.o parse_func.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_merge.o parse_merge.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_node.o parse_node.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_oper.o parse_oper.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_param.o parse_param.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_relation.o parse_relation.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_target.o parse_target.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_type.o parse_type.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_utilcmd.o parse_utilcmd.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parser.o parser.c
/usr/local/bin/flex -b -CF -p -p -o'scan.c' scan.l
'/usr/bin/perl' ../../../src/tools/fix-old-flex-code.pl 'scan.c'
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o scan.o scan.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o scansup.o scansup.c
/usr/lib/llvm-16/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2 -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -flto=thin -emit-llvm -c -o parser.bc parser.c
$ ls
analyze.c gram.o parse_agg.c parse_coerce.o parse_enr.c parse_func.o parse_oper.c parser.c parse_target.o README scansup.o
analyze.o gramparse.h parse_agg.o parse_collate.c parse_enr.o parse_merge.c parse_oper.o parse_relation.c parse_type.c scan.c
check_keywords.pl gram.y parse_clause.c parse_collate.o parse_expr.c parse_merge.o parse_param.c parse_relation.o parse_type.o scan.l
gram.c Makefile parse_clause.o parse_cte.c parse_expr.o parse_node.c parse_param.o parser.o parse_utilcmd.c scan.o
gram.h meson.build parse_coerce.c parse_cte.o parse_func.c parse_node.o parser.bc parse_target.c parse_utilcmd.o scansup.c
Attachments:
[text/plain] bc-depends-on-c.txt (1.0K, 2-bc-depends-on-c.txt)
download | inline:
$ make parser.bc
'/usr/bin/perl' ./check_keywords.pl gram.y ../../../src/include/parser/kwlist.h
/usr/local/bin/bison -Wno-deprecated -d -o gram.c gram.y
/usr/local/bin/flex -b -CF -p -p -o'scan.c' scan.l
'/usr/bin/perl' ../../../src/tools/fix-old-flex-code.pl 'scan.c'
/usr/lib/llvm-16/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2 -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -flto=thin -emit-llvm -c -o parser.bc parser.c
$ ls
analyze.c gram.h Makefile parse_clause.c parse_cte.c parse_func.c parse_oper.c parser.c parse_type.c scan.c
check_keywords.pl gramparse.h meson.build parse_coerce.c parse_enr.c parse_merge.c parse_param.c parse_relation.c parse_utilcmd.c scan.l
gram.c gram.y parse_agg.c parse_collate.c parse_expr.c parse_node.c parser.bc parse_target.c README scansup.c
[text/plain] bc-depends-on-o.txt (12.3K, 3-bc-depends-on-o.txt)
download | inline:
$ make parser.bc
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o analyze.o analyze.c
'/usr/bin/perl' ./check_keywords.pl gram.y ../../../src/include/parser/kwlist.h
/usr/local/bin/bison -Wno-deprecated -d -o gram.c gram.y
touch gram.h
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o gram.o gram.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_agg.o parse_agg.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_clause.o parse_clause.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_coerce.o parse_coerce.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_collate.o parse_collate.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_cte.o parse_cte.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_enr.o parse_enr.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_expr.o parse_expr.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_func.o parse_func.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_merge.o parse_merge.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_node.o parse_node.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_oper.o parse_oper.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_param.o parse_param.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_relation.o parse_relation.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_target.o parse_target.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_type.o parse_type.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parse_utilcmd.o parse_utilcmd.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o parser.o parser.c
/usr/local/bin/flex -b -CF -p -p -o'scan.c' scan.l
'/usr/bin/perl' ../../../src/tools/fix-old-flex-code.pl 'scan.c'
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o scan.o scan.c
clang-16 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -ggdb -O0 -g3 -fno-omit-frame-pointer -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -c -o scansup.o scansup.c
/usr/lib/llvm-16/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2 -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -flto=thin -emit-llvm -c -o parser.bc parser.c
$ ls
analyze.c gram.o parse_agg.c parse_coerce.o parse_enr.c parse_func.o parse_oper.c parser.c parse_target.o README scansup.o
analyze.o gramparse.h parse_agg.o parse_collate.c parse_enr.o parse_merge.c parse_oper.o parse_relation.c parse_type.c scan.c
check_keywords.pl gram.y parse_clause.c parse_collate.o parse_expr.c parse_merge.o parse_param.c parse_relation.o parse_type.o scan.l
gram.c Makefile parse_clause.o parse_cte.c parse_expr.o parse_node.c parse_param.o parser.o parse_utilcmd.c scan.o
gram.h meson.build parse_coerce.c parse_cte.o parse_func.c parse_node.o parser.bc parse_target.c parse_utilcmd.o scansup.c
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: .bc files build dependency issues.
2026-03-30 07:28 .bc files build dependency issues. Anton A. Melnikov <[email protected]>
@ 2026-03-30 12:39 ` Andres Freund <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Andres Freund @ 2026-03-30 12:39 UTC (permalink / raw)
To: Anton A. Melnikov <[email protected]>; +Cc: pgsql-hackers
Hi,
On 2026-03-30 10:28:30 +0300, Anton A. Melnikov wrote:
> While the original discussion was about a specific commit
> ecaf7c5df and related fix in 16492df7 for 16+
> and its effects [1], i would like to point out that
> a similar behavior can be observed
> on earlier stable branches (REL_14/15_STABLE) as well.
> Using a pre-built source tree and the following reproduction
> that is slightly modified version from [2] which suggests
> that this is a known pattern for exposing the issue:
>
> cd src/backend/parser
> rm -rf .deps/ gram.c scan.c *.o *.bc gram.h
> make parser.bc
IOW, if you do something that intentionally breaks things, things break.
> result in:
>
> $ make parser.bc
> /usr/lib/llvm-16/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Xclang
> -no-opaque-pointers -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-deprecated-non-prototype
> -O2 -I. -I. -I../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/local/include -flto=thin -emit-llvm
> -c -o parser.bc parser.c
> In file included from parser.c:25:
> ../../../src/include/parser/gramparse.h:29:10: fatal error: 'parser/gram.h' file not found
> #include "parser/gram.h"
> ^~~~~~~~~~~~~~~
> 1 error generated.
> make: *** [../../../src/Makefile.global:1084: parser.bc] Error 1
>
> Since this can be reproduced reliably on REL_14/15, it seems worth asking
> whether fix for .bc files (or something equivalent) should also be
> backpatched to lower branches, instead of only applying to newer ones.
This seems like a complete non-issue to me. What is the actual problem here?
You intentionally removed dependency information. You intentionally removed
part of the generated files, but not all of them.
> Also as a possible improvement perhaps make the fix less strictly?
> I.e. replace each .bc file's dependency on all .o files
> with a more weak dependency just on all source .c files.
> Namely use:
>
> $(patsubst %.o,%.bc, $(OBJS)): $(patsubst %.o,%.c, $(OBJS))
>
> instead of:
>
> $(patsubst %.o,%.bc, $(OBJS)): $(OBJS)
>
> This might still preserve correct build ordering while reducing
> unnecessary coupling between targets.
It'd also be broken if one of the source files is built from c++, for example.
> As a result make will run faster during parallel builds since it won't wait
> for absolutely all the object files to be created.
>
> For example, rebuilding parser.bc would then require only
> a single compiler call in src/backend/parser instead of many.
The other file also needs to be built. The .bc->.o dependency will actually
often prevent redundant error messages.
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-03-30 12:39 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-03-30 07:28 .bc files build dependency issues. Anton A. Melnikov <[email protected]>
2026-03-30 12:39 ` Andres Freund <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox