]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - lfs/glibc
suricata: Change midstream policy to "pass-flow"
[people/pmueller/ipfire-2.x.git] / lfs / glibc
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2021 IPFire Team <info@ipfire.org> #
5 # #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
18 # #
19 ###############################################################################
20
21 ###############################################################################
22 # Definitions
23 ###############################################################################
24
25 include Config
26
27 VER = 2.37
28
29 THISAPP = glibc-$(VER)
30 DL_FILE = $(THISAPP).tar.xz
31 DL_FROM = $(URL_IPFIRE)
32 DIR_APP = $(DIR_SRC)/$(THISAPP)
33
34 # Normal build or $(TOOLS_DIR) build.
35 #
36 ifeq "$(ROOT)" ""
37 TARGET = $(DIR_INFO)/$(THISAPP)
38 EXTRA_CONFIG = \
39 --build=$(BUILDTARGET) \
40 --prefix=/usr \
41 --libexecdir=/usr/lib/glibc \
42 --enable-stack-protector=strong
43 else
44 TARGET = $(DIR_INFO)/$(THISAPP)-tools
45 EXTRA_CONFIG = \
46 --host=$(CROSSTARGET) \
47 --build=$(BUILDTARGET) \
48 --prefix=$(TOOLS_DIR) \
49 --with-headers=$(TOOLS_DIR)/include
50 endif
51
52 ifeq "$(BUILD_ARCH)" "aarch64"
53 CFLAGS += -Wno-error=maybe-uninitialized
54 endif
55
56 # Add some general configuration flags
57 EXTRA_CONFIG += \
58 --disable-profile \
59 --enable-kernel=4.14.0 \
60 --enable-add-ons \
61 --without-selinux \
62 --enable-experimental-malloc \
63 --enable-bind-now \
64 --disable-crypt
65
66 ifeq "$(BUILD_ARCH)" "x86_64"
67 EXTRA_CONFIG += --enable-cet
68 endif
69
70 ifeq "$(BUILD_ARCH)" "aarch64"
71 EXTRA_CONFIG += --enable-memory-tagging
72 endif
73
74 ###############################################################################
75 # Top-level Rules
76 ###############################################################################
77
78 objects = $(DL_FILE)
79
80 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
81
82 $(DL_FILE)_BLAKE2 = 8139cd977b2ed3bfdbde5ffb1cda8f759763dbb83071167272fef798cfbdc0d17cfd1ec893d126c52c91511b7961f3ad12eed34534b99412dfa04a1cdd5b4ea3
83
84 install : $(TARGET)
85
86 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
87
88 download :$(patsubst %,$(DIR_DL)/%,$(objects))
89
90 b2 : $(subst %,%_BLAKE2,$(objects))
91
92 ###############################################################################
93 # Downloading, checking, b2sum
94 ###############################################################################
95
96 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
97 @$(CHECK)
98
99 $(patsubst %,$(DIR_DL)/%,$(objects)) :
100 @$(LOAD)
101
102 $(subst %,%_BLAKE2,$(objects)) :
103 @$(B2SUM)
104
105 ###############################################################################
106 # Installation Details
107 ###############################################################################
108
109 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
110 @$(PREBUILD)
111 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
112 @mkdir $(DIR_SRC)/glibc-build
113
114 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-localedef-no-archive.patch
115
116 ifneq "$(TOOLCHAIN)" "1"
117 ifeq "$(BUILD_ARCH)" "x86_64"
118 cd $(DIR_APP) && sed -i 's|libs -o|libs -L/usr/lib64 -Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 -o|' \
119 scripts/test-installation.pl
120 endif
121 endif
122
123 cd $(DIR_SRC)/glibc-build && \
124 CFLAGS="$(CFLAGS) -fno-asynchronous-unwind-tables" \
125 $(DIR_APP)/configure $(EXTRA_CONFIG)
126
127 cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=$(MAKETUNING) \
128 CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)"
129
130 cd $(DIR_APP) && sed '/test-installation/s@\$$(PERL)@echo not running@' -i Makefile
131
132 cd $(DIR_SRC)/glibc-build && make install
133
134 ifneq "$(TOOLCHAIN)" "1"
135 # Creating the locales
136 mkdir -p /usr/lib/locale
137 cd $(DIR_SRC)/glibc-build && make localedata/install-locales $(MAKETUNING)
138
139 # Timezone data will be shipped by tzdata.
140 rm -rfv /usr/share/zoneinfo
141 endif
142
143 ifeq "$(TOOLCHAIN)" "1"
144 # Test the linker in toolchain
145 cd $(DIR_APP) && echo "int main() { return 0; }" > dummy.c
146 cd $(DIR_APP) && $(CROSSTARGET)-gcc dummy.c -o dummy
147
148 # Must be using a runtime linker from $(TOOLS_DIR)
149 cd $(DIR_APP) && readelf -l dummy | grep "Requesting program interpreter: $(TOOLS_DIR)"
150 cd $(DIR_APP) && rm -vf dummy dummy.c
151 endif
152
153 @rm -rf $(DIR_APP) $(DIR_SRC)/glibc-build
154 @$(POSTBUILD)