]> git.pld-linux.org Git - packages/Firebird.git/blame - parallel-build.patch
- rediffed patches
[packages/Firebird.git] / parallel-build.patch
CommitLineData
8f47d69b
AM
1Description: allow building with make -jN
2 without this there are sporadic segmentation faults
3 .
4 it seems that when gpre opens a database, it clashes with other gpre
5 processes that have the database open. perhaps this is because at
6 this stage of the build the compiled firebird engine lacks ability for
7 synchronisation. So, wrap all engine-using calls with a lock file
8Author: Damyan Ivanov <dmn@debian.org>
9Forwarded: no
10
7130cd50
MK
11diff -urNp -x '*.orig' Firebird-3.0.7.33374-0.org/builds/posix/Makefile.in Firebird-3.0.7.33374-0/builds/posix/Makefile.in
12--- Firebird-3.0.7.33374-0.org/builds/posix/Makefile.in 2022-04-04 17:53:31.957821756 +0000
13+++ Firebird-3.0.7.33374-0/builds/posix/Makefile.in 2022-04-04 17:53:33.598825549 +0000
14@@ -359,8 +359,8 @@ yachts.lnk: metadata.fdb
8f47d69b
AM
15
16 metadata.fdb: $(RUN_ISQL) $(SRC_ROOT)/dbs/metadata.sql
17 -$(RM) $@
18- $(RUN_ISQL) -q -i $(SRC_ROOT)/dbs/metadata.sql
19- $(RUN_GFIX) -mode read_only $@
20+ $(call LOCK_RUN,$(RUN_ISQL) -q -i $(SRC_ROOT)/dbs/metadata.sql)
21+ $(call LOCK_RUN,$(RUN_GFIX) -mode read_only $@)
22 $(CHMOD) 0444 $@
23
24 $(HELP_FDB): help.fdb
7130cd50 25@@ -369,7 +369,7 @@ $(HELP_FDB): help.fdb
8f47d69b
AM
26 $(CHMOD) 0444 $@
27
28 help.fdb: $(BLD_ROOT)/misc/help.gbak
29- $(RUN_GBAK) -MODE read_only -R $< $@
30+ $(call LOCK_RUN,$(RUN_GBAK) -MODE read_only -R $< $@)
31 $(CHMOD) 0444 $@
32
33 $(SECURITY_FDB): security.fdb
7130cd50 34@@ -379,18 +379,18 @@ $(SECURITY_FDB): security.fdb
8f47d69b
AM
35 security.fdb: $(SRC_ROOT)/dbs/security.sql
36 -$(RM) $@
37 -$(RM) $(SECURITY_TMP)
38- echo create database \'$(SECURITY_TMP)\'\; | $(RUN_ISQL)
39- $(RUN_GFIX) -write async $(SECURITY_TMP)
40- $(RUN_ISQL) -i $^ $(SECURITY_TMP)
41+ $(call LOCK_RUN,echo create database \'$(SECURITY_TMP)\'\; | $(RUN_ISQL))
42+ $(call LOCK_RUN,$(RUN_GFIX) -write async $(SECURITY_TMP))
43+ $(call LOCK_RUN,$(RUN_ISQL) -i $^ $(SECURITY_TMP))
44 $(CHMOD) a=rw $(SECURITY_TMP)
45 $(CP) $(SECURITY_TMP) $@
46- $(RUN_GFIX) -write sync $@
47+ $(call LOCK_RUN,$(RUN_GFIX) -write sync $@)
48
49 msg.timestamp: $(MSG_FILES)
50 -$(RM) msg.fdb
51- echo create database \'msg.fdb\'\; | $(RUN_ISQL)
52- $(RUN_GFIX) -write async msg.fdb
53- for sql in $(MSG_FILES); do (echo $$sql; $(RUN_ISQL) -i $$sql msg.fdb) || exit; done
54+ $(call LOCK_RUN,echo create database \'msg.fdb\'\; | $(RUN_ISQL))
55+ $(call LOCK_RUN,$(RUN_GFIX) -write async msg.fdb)
56+ $(call LOCK_RUN,for sql in $(MSG_FILES); do (echo $$sql; $(RUN_ISQL) -i $$sql msg.fdb) || exit; done)
57 $(TOUCH) $@
58
59
7130cd50 60@@ -562,7 +562,7 @@ codes: gen_codes
8f47d69b
AM
61 ids: $(IDS)
62
63 gen_codes: $(CODES) msg.timestamp
64- $(CODES) $(SRC_ROOT)/include/gen $(LNG_ROOT)
65+ $(call LOCK_RUN,$(CODES) $(SRC_ROOT)/include/gen $(LNG_ROOT))
66
67 $(CODES): $(CODES_Objects) $(COMMON_LIB)
7130cd50
MK
68 $(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) $(LINK_LIBS) $(call LINK_DARWIN_RPATH,..)
69@@ -598,7 +598,7 @@ examples: include_generic
8f47d69b
AM
70 message_file: $(FIREBIRD_MSG)
71
72 $(FIREBIRD_MSG): $(BUILD_FILE) msg.timestamp
73- $(BUILD_FILE) -d msg.fdb -f $@
74+ $(call LOCK_RUN,$(BUILD_FILE) -d msg.fdb -f $@)
75 $(CHMOD_6) $@
76
77 $(BUILD_FILE): $(BUILD_Objects) $(COMMON_LIB)
7130cd50
MK
78diff -urNp -x '*.orig' Firebird-3.0.7.33374-0.org/builds/posix/Makefile.in.examples Firebird-3.0.7.33374-0/builds/posix/Makefile.in.examples
79--- Firebird-3.0.7.33374-0.org/builds/posix/Makefile.in.examples 2020-10-20 08:40:05.000000000 +0000
80+++ Firebird-3.0.7.33374-0/builds/posix/Makefile.in.examples 2022-04-04 17:53:33.598825549 +0000
81@@ -123,8 +123,8 @@ $(EXAMPLES_DEST)% : $(EXAMPLES_SRC)%
82
83 $(EMPLOYEE_DB): $(EXAMPLES_DEST)/empbuild$(EXEC_EXT) $(INPUT_Sources) $(EXAMPLES_DEST)/isql$(EXEC_EXT)
84 -$(RM) $(EMPLOYEE_DB)
85- ./empbuild $(EMPLOYEE_DB)
86- $(GFIX) -write sync $(EMPLOYEE_DB)
87+ $(call LOCK_RUN,./empbuild $(EMPLOYEE_DB))
88+ $(call LOCK_RUN,$(GFIX) -write sync $(EMPLOYEE_DB))
89 -$(CHMOD_6) $(EMPLOYEE_DB)
90
91 # To get past the fact isql is called from the programs, we create a local link in this directory
92@@ -140,7 +140,7 @@ $(EXAMPLES_DEST)/empbuild.c: $(EXAMPLES_
93
94 $(EXAMPLES_DEST)/empbuild.fdb : $(EXAMPLES_DEST)/empddl.sql $(EXAMPLES_DEST)/empbld.sql $(EXAMPLES_DEST)/isql$(EXEC_EXT)
95 -$(RM) $(EXAMPLES_DEST)/empbuild.fdb
96- $(EXAMPLES_DEST)/isql$(EXEC_EXT) -i empbld.sql
97+ $(call LOCK_RUN,$(EXAMPLES_DEST)/isql$(EXEC_EXT) -i empbld.sql)
98
99 # The chain for intlemp.fdb is the same a script file to create an empty database
100 # to allow a .e program to be compiled, to then create and populate with data
101@@ -148,7 +148,7 @@ $(EXAMPLES_DEST)/empbuild.fdb : $(EXAMPL
102
103 $(EXAMPLES_DEST)/intlemp.fdb: $(EXAMPLES_DEST)/intlbld$(EXEC_EXT) $(INTL_Sources) $(EXAMPLES_DEST)/isql$(EXEC_EXT)
104 -$(RM) intlemp.fdb
105- ./intlbld intlemp.fdb
106+ $(call LOCK_RUN,./intlbld intlemp.fdb)
107 -$(CHMOD_6) intlemp.fdb
108
109 $(EXAMPLES_DEST)/intlbld$(EXEC_EXT): $(INTLBLD_Objects) $(COMMON_LIB)
110@@ -158,7 +158,7 @@ $(EXAMPLES_DEST)/intlbld.c: $(EXAMPLES_D
111
112 $(EXAMPLES_DEST)/intlbuild.fdb : $(EXAMPLES_DEST)/intlddl.sql $(EXAMPLES_DEST)/intlbld.sql $(EXAMPLES_DEST)/isql$(EXEC_EXT)
113 -$(RM) intlbuild.fdb
114- $(EXAMPLES_DEST)/isql$(EXEC_EXT) -i intlbld.sql
115+ $(call LOCK_RUN,$(EXAMPLES_DEST)/isql$(EXEC_EXT) -i intlbld.sql)
116
117
118 $(EXAMPLES_DEST)/%.sql: $(EXAMPLES_SRC)/empbuild/%.sql
119diff -urNp -x '*.orig' Firebird-3.0.7.33374-0.org/builds/posix/make.defaults Firebird-3.0.7.33374-0/builds/posix/make.defaults
120--- Firebird-3.0.7.33374-0.org/builds/posix/make.defaults 2022-04-04 17:53:31.949821738 +0000
121+++ Firebird-3.0.7.33374-0/builds/posix/make.defaults 2022-04-04 17:53:33.598825549 +0000
122@@ -397,6 +397,7 @@ GPRE_BOOT = $(RBIN)/gpre_boot$(EXE
8f47d69b
AM
123 GPRE = $(BIN)/gpre$(EXEC_EXT)
124 RUN_GPRE = $(RBIN)/gpre$(EXEC_EXT)
125 GPRE_CURRENT = $(RBIN)/gpre_current$(EXEC_EXT)
126+LOCK_RUN = sh -x -c "lockfile -1 $(BIN)/build-db.lock && $(subst $$,\$$,$(1)); res=\$$?; rm -f $(BIN)/build-db.lock; exit \$$res"
127
128
129 # From msgs
7130cd50
MK
130diff -urNp -x '*.orig' Firebird-3.0.7.33374-0.org/builds/posix/make.rules Firebird-3.0.7.33374-0/builds/posix/make.rules
131--- Firebird-3.0.7.33374-0.org/builds/posix/make.rules 2020-10-20 08:40:05.000000000 +0000
132+++ Firebird-3.0.7.33374-0/builds/posix/make.rules 2022-04-04 17:53:33.598825549 +0000
8f47d69b
AM
133@@ -72,17 +72,17 @@ ISQL_GPRE_FLAGS = -m -z -n -ocxx
134 .SUFFIXES: .c .e .epp .cpp
135
136 .e.c:
137- $(GPRE_CURRENT) $(GPRE_FLAGS) $< $@
138+ $(call LOCK_RUN,$(GPRE_CURRENT) $(GPRE_FLAGS) $< $@)
139
140
141 $(OBJ)/jrd/%.cpp: $(SRC_ROOT)/jrd/%.epp
142- $(GPRE_CURRENT) $(JRD_GPRE_FLAGS) $(firstword $<) $@
143+ $(call LOCK_RUN,$(GPRE_CURRENT) $(JRD_GPRE_FLAGS) $(firstword $<) $@)
144
145 $(OBJ)/isql/%.cpp: $(SRC_ROOT)/isql/%.epp
146- $(GPRE_CURRENT) $(ISQL_GPRE_FLAGS) $< $@
147+ $(call LOCK_RUN,$(GPRE_CURRENT) $(ISQL_GPRE_FLAGS) $< $@)
148
149 $(OBJ)/%.cpp: $(SRC_ROOT)/%.epp
150- $(GPRE_CURRENT) $(GPRE_FLAGS) $(firstword $<) $@
151+ $(call LOCK_RUN,$(GPRE_CURRENT) $(GPRE_FLAGS) $(firstword $<) $@)
152
153
154 .SUFFIXES: .lo .o .cpp .c
7130cd50
MK
155diff -urNp -x '*.orig' Firebird-3.0.7.33374-0.org/builds/posix/make.shared.targets Firebird-3.0.7.33374-0/builds/posix/make.shared.targets
156--- Firebird-3.0.7.33374-0.org/builds/posix/make.shared.targets 2020-10-20 08:40:05.000000000 +0000
157+++ Firebird-3.0.7.33374-0/builds/posix/make.shared.targets 2022-04-04 17:53:33.598825549 +0000
158@@ -65,13 +65,13 @@ $(OBJ)/dsql/Parser.o $(OBJ)/common/keywo
8f47d69b
AM
159
160 # Special cases for building cpp from epp
161 $(OBJ)/dsql/metd.cpp: $(SRC_ROOT)/dsql/metd.epp
162- $(GPRE_CURRENT) $(JRD_GPRE_FLAGS) $< $@
163+ $(call LOCK_RUN,$(GPRE_CURRENT) $(JRD_GPRE_FLAGS) $< $@)
164
165 $(OBJ)/dsql/DdlNodes.cpp: $(SRC_ROOT)/dsql/DdlNodes.epp
166- $(GPRE_CURRENT) $(JRD_GPRE_FLAGS) $< $@
167+ $(call LOCK_RUN,$(GPRE_CURRENT) $(JRD_GPRE_FLAGS) $< $@)
168
169 $(OBJ)/dsql/PackageNodes.cpp: $(SRC_ROOT)/dsql/PackageNodes.epp
170- $(GPRE_CURRENT) $(JRD_GPRE_FLAGS) $< $@
171+ $(call LOCK_RUN,$(GPRE_CURRENT) $(JRD_GPRE_FLAGS) $< $@)
172
173 # Adding resources as prerequisite for some files
174
This page took 0.125995 seconds and 4 git commands to generate.