Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit29180e5

Browse files
committed
Eliminate parallel-make hazard in ecpg/preproc.
Re-making ecpglib's typename.o is dangerous because another make threadcould be doing that at the same time. While we've not heard fieldcomplaints traceable to this, it seems inevitable that it'd bite someoneeventually. Instead, symlink typename.c into the preproc directory andrecompile it there. That file is small enough that compiling it twiceisn't much of a penalty. Furthermore, this way we get a .o file that'smade without shlib CFLAGS, which seems cleaner.This requires adding more stuff to the module's -I list. The MSVCaspect of that is untested, but I'm sure the buildfarm will tell meif I got it wrong.Per a suggestion from Peter Eisentraut. Although this is theoreticallya bug fix, the lack of field reports makes me feel we needn't back-patch.Discussion:https://postgr.es/m/31364.1543511708@sss.pgh.pa.us
1 parent3295f82 commit29180e5

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

‎src/interfaces/ecpg/preproc/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
/preproc.c
33
/preproc.h
44
/pgc.c
5-
5+
/typename.c
66
/ecpg

‎src/interfaces/ecpg/preproc/Makefile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ top_builddir = ../../../..
1616
include$(top_builddir)/src/Makefile.global
1717

1818
overrideCPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include\
19-
-I. -I$(srcdir) -DECPG_COMPILE\
20-
$(CPPFLAGS)
19+
-I. -I$(srcdir)\
20+
-I$(top_srcdir)/src/interfaces/ecpg/ecpglib\
21+
-I$(libpq_srcdir)\
22+
-DECPG_COMPILE\
23+
$(CPPFLAGS)
2124

2225
overrideCFLAGS +=$(PTHREAD_CFLAGS)
2326

2427
OBJS=preproc.o pgc.o type.o ecpg.o output.o parser.o\
25-
keywords.o c_keywords.o ecpg_keywords.o../ecpglib/typename.o descriptor.o variable.o\
28+
keywords.o c_keywords.o ecpg_keywords.o typename.o descriptor.o variable.o\
2629
$(WIN32RES)
2730

2831
# Suppress parallel build to avoid a bug in GNU make 3.82
@@ -36,8 +39,9 @@ all: ecpg
3639
ecpg:$(OBJS) | submake-libpgport
3740
$(CC)$(CFLAGS)$(LDFLAGS)$(LDFLAGS_EX)$^$(LIBS)$(PTHREAD_LIBS) -o$@$(X)
3841

39-
../ecpglib/typename.o: ../ecpglib/typename.c
40-
$(MAKE) -C$(dir$@)$(notdir$@)
42+
# We symlink typename.c from ecpglib and recompile it here
43+
typename.c:% :$(top_srcdir)/src/interfaces/ecpg/ecpglib/%
44+
rm -f$@&&$(LN_S)$<.
4145

4246
# See notes in src/backend/parser/Makefile about the following two rules
4347
preproc.h: preproc.c
@@ -64,6 +68,7 @@ uninstall:
6468

6569
cleandistclean:
6670
rm -f*.o ecpg$(X)
71+
rm -f typename.c
6772

6873
# `make distclean' must not remove preproc.y, preproc.c, preproc.h, or pgc.c
6974
# since we want to ship those files in the distribution for people with

‎src/tools/msvc/Mkvcbuild.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ sub mkvcbuild
291291
my$ecpg =$solution->AddProject('ecpg','exe','interfaces',
292292
'src/interfaces/ecpg/preproc');
293293
$ecpg->AddIncludeDir('src/interfaces/ecpg/include');
294+
$ecpg->AddIncludeDir('src/interfaces/ecpg/ecpglib');
294295
$ecpg->AddIncludeDir('src/interfaces/libpq');
295296
$ecpg->AddPrefixInclude('src/interfaces/ecpg/preproc');
296297
$ecpg->AddFiles('src/interfaces/ecpg/preproc','pgc.l','preproc.y');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp