]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/glibc/glibc.mk
glibc: security bump to the latest commit on 2.26 branch
[coffee/buildroot.git] / package / glibc / glibc.mk
1 ################################################################################
2 #
3 # glibc
4 #
5 ################################################################################
6
7 ifeq ($(BR2_arc),y)
8 GLIBC_VERSION =  arc-2017.09-release
9 GLIBC_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,glibc,$(GLIBC_VERSION))
10 else
11 # Generate version string using:
12 #   git describe --match 'glibc-*' --abbrev=40 origin/release/MAJOR.MINOR/master
13 GLIBC_VERSION = glibc-2.26-146-gd300041c533a3d837c9f37a099bcc95466860e98
14 # Upstream doesn't officially provide an https download link.
15 # There is one (https://sourceware.org/git/glibc.git) but it's not reliable,
16 # sometimes the connection times out. So use an unofficial github mirror.
17 # When updating the version, check it on the official repository;
18 # *NEVER* decide on a version string by looking at the mirror.
19 # Then check that the mirror has been synced already (happens once a day.)
20 GLIBC_SITE = $(call github,bminor,glibc,$(GLIBC_VERSION))
21 endif
22
23 GLIBC_SRC_SUBDIR = .
24
25 GLIBC_LICENSE = GPL-2.0+ (programs), LGPL-2.1+, BSD-3-Clause, MIT (library)
26 GLIBC_LICENSE_FILES = $(addprefix $(GLIBC_SRC_SUBDIR)/,COPYING COPYING.LIB LICENSES)
27
28 # glibc is part of the toolchain so disable the toolchain dependency
29 GLIBC_ADD_TOOLCHAIN_DEPENDENCY = NO
30
31 # Before glibc is configured, we must have the first stage
32 # cross-compiler and the kernel headers
33 GLIBC_DEPENDENCIES = host-gcc-initial linux-headers host-gawk
34
35 GLIBC_SUBDIR = build
36
37 GLIBC_INSTALL_STAGING = YES
38
39 GLIBC_INSTALL_STAGING_OPTS = install_root=$(STAGING_DIR) install
40
41 # Thumb build is broken, build in ARM mode
42 ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
43 GLIBC_EXTRA_CFLAGS += -marm
44 endif
45
46 # MIPS64 defaults to n32 so pass the correct -mabi if
47 # we are using a different ABI. OABI32 is also used
48 # in MIPS so we pass -mabi=32 in this case as well
49 # even though it's not strictly necessary.
50 ifeq ($(BR2_MIPS_NABI64),y)
51 GLIBC_EXTRA_CFLAGS += -mabi=64
52 else ifeq ($(BR2_MIPS_OABI32),y)
53 GLIBC_EXTRA_CFLAGS += -mabi=32
54 endif
55
56 ifeq ($(BR2_ENABLE_DEBUG),y)
57 GLIBC_EXTRA_CFLAGS += -g
58 endif
59
60 # The stubs.h header is not installed by install-headers, but is
61 # needed for the gcc build. An empty stubs.h will work, as explained
62 # in http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html. The same trick
63 # is used by Crosstool-NG.
64 ifeq ($(BR2_TOOLCHAIN_BUILDROOT_GLIBC),y)
65 define GLIBC_ADD_MISSING_STUB_H
66         mkdir -p $(STAGING_DIR)/usr/include/gnu
67         touch $(STAGING_DIR)/usr/include/gnu/stubs.h
68 endef
69 endif
70
71 # Even though we use the autotools-package infrastructure, we have to
72 # override the default configure commands for several reasons:
73 #
74 #  1. We have to build out-of-tree, but we can't use the same
75 #     'symbolic link to configure' used with the gcc packages.
76 #
77 #  2. We have to execute the configure script with bash and not sh.
78 #
79 # Note that as mentionned in
80 # http://patches.openembedded.org/patch/38849/, glibc must be
81 # built with -O2, so we pass our own CFLAGS and CXXFLAGS below.
82 define GLIBC_CONFIGURE_CMDS
83         mkdir -p $(@D)/build
84         # Do the configuration
85         (cd $(@D)/build; \
86                 $(TARGET_CONFIGURE_OPTS) \
87                 CFLAGS="-O2 $(GLIBC_EXTRA_CFLAGS)" CPPFLAGS="" \
88                 CXXFLAGS="-O2 $(GLIBC_EXTRA_CFLAGS)" \
89                 $(SHELL) $(@D)/$(GLIBC_SRC_SUBDIR)/configure \
90                 ac_cv_path_BASH_SHELL=/bin/bash \
91                 libc_cv_forced_unwind=yes \
92                 libc_cv_ssp=no \
93                 --target=$(GNU_TARGET_NAME) \
94                 --host=$(GNU_TARGET_NAME) \
95                 --build=$(GNU_HOST_NAME) \
96                 --prefix=/usr \
97                 --enable-shared \
98                 $(if $(BR2_SOFT_FLOAT),--without-fp,--with-fp) \
99                 $(if $(BR2_x86_64),--enable-lock-elision) \
100                 --with-pkgversion="Buildroot" \
101                 --without-cvs \
102                 --disable-profile \
103                 --without-gd \
104                 --enable-obsolete-rpc \
105                 --enable-kernel=$(call qstrip,$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)) \
106                 --with-headers=$(STAGING_DIR)/usr/include)
107         $(GLIBC_ADD_MISSING_STUB_H)
108 endef
109
110 #
111 # We also override the install to target commands since we only want
112 # to install the libraries, and nothing more.
113 #
114
115 GLIBC_LIBS_LIB = \
116         ld*.so.* libanl.so.* libc.so.* libcrypt.so.* libdl.so.* libgcc_s.so.* \
117         libm.so.* libnsl.so.* libpthread.so.* libresolv.so.* librt.so.* \
118         libutil.so.* libnss_files.so.* libnss_dns.so.* libmvec.so.*
119
120 ifeq ($(BR2_PACKAGE_GDB),y)
121 GLIBC_LIBS_LIB += libthread_db.so.*
122 endif
123
124 define GLIBC_INSTALL_TARGET_CMDS
125         for libpattern in $(GLIBC_LIBS_LIB); do \
126                 $(call copy_toolchain_lib_root,$$libpattern) ; \
127         done
128 endef
129
130 $(eval $(autotools-package))