1
1
#
2
- # Copyright (c) 2013, 2020 , Oracle and/or its affiliates. All rights reserved.
2
+ # Copyright (c) 2013, 2022 , Oracle and/or its affiliates. All rights reserved.
3
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
#
5
5
# This code is free software; you can redistribute it and/or modify it
@@ -63,20 +63,28 @@ ifeq ($(BASE_OS), OL)
63
63
LINUX_VERSION := OL6.4
64
64
endif
65
65
else ifeq ($(BASE_OS), Fedora)
66
- DEFAULT_OS_VERSION := 27
67
- ifeq ($(BASE_OS_VERSION), )
68
- BASE_OS_VERSION := $(DEFAULT_OS_VERSION)
69
- endif
70
- ifeq ($(filter x86_64 armhfp, $(ARCH)), )
71
- FEDORA_TYPE := fedora-secondary
72
- else
73
- FEDORA_TYPE := fedora/linux
74
- endif
75
- ARCHIVED := $(shell [ $(BASE_OS_VERSION) -lt $(DEFAULT_OS_VERSION) ] && echo true)
76
- ifeq ($(ARCHIVED),true)
77
- BASE_URL := https://archives.fedoraproject.org/pub/archive/$(FEDORA_TYPE)/releases/$(BASE_OS_VERSION)/Everything/$(ARCH)/os/Packages/
66
+ ifeq ($(ARCH), riscv64)
67
+ DEFAULT_OS_VERSION := rawhide/68692
68
+ ifeq ($(BASE_OS_VERSION), )
69
+ BASE_OS_VERSION := $(DEFAULT_OS_VERSION)
70
+ endif
71
+ BASE_URL := http://fedora.riscv.rocks/repos-dist/$(BASE_OS_VERSION)/$(ARCH)/Packages/
78
72
else
79
- BASE_URL := https://dl.fedoraproject.org/pub/$(FEDORA_TYPE)/releases/$(BASE_OS_VERSION)/Everything/$(ARCH)/os/Packages/
73
+ DEFAULT_OS_VERSION := 27
74
+ ifeq ($(BASE_OS_VERSION), )
75
+ BASE_OS_VERSION := $(DEFAULT_OS_VERSION)
76
+ endif
77
+ ifeq ($(filter x86_64 armhfp, $(ARCH)), )
78
+ FEDORA_TYPE := fedora-secondary
79
+ else
80
+ FEDORA_TYPE := fedora/linux
81
+ endif
82
+ ARCHIVED := $(shell [ $(BASE_OS_VERSION) -lt $(DEFAULT_OS_VERSION) ] && echo true)
83
+ ifeq ($(ARCHIVED),true)
84
+ BASE_URL := https://archives.fedoraproject.org/pub/archive/$(FEDORA_TYPE)/releases/$(BASE_OS_VERSION)/Everything/$(ARCH)/os/Packages/
85
+ else
86
+ BASE_URL := https://dl.fedoraproject.org/pub/$(FEDORA_TYPE)/releases/$(BASE_OS_VERSION)/Everything/$(ARCH)/os/Packages/
87
+ endif
80
88
endif
81
89
LINUX_VERSION := Fedora_$(BASE_OS_VERSION)
82
90
else
87
95
# Define external dependencies
88
96
89
97
# Latest that could be made to work.
90
- GCC_VER := 11.2.0
91
- ifeq ($(GCC_VER), 11.2.0)
98
+ GCC_VER := 11.3.0
99
+ ifeq ($(GCC_VER), 11.3.0)
100
+ gcc_ver := gcc-11.3.0
101
+ binutils_ver := binutils-2.39
102
+ ccache_ver := ccache-3.7.12
103
+ mpfr_ver := mpfr-4.1.1
104
+ gmp_ver := gmp-6.2.1
105
+ mpc_ver := mpc-1.2.1
106
+ gdb_ver := gdb-11.2
107
+ REQUIRED_MIN_MAKE_MAJOR_VERSION := 4
108
+ else ifeq ($(GCC_VER), 11.2.0)
92
109
gcc_ver := gcc-11.2.0
93
110
binutils_ver := binutils-2.37
94
111
ccache_ver := ccache-3.7.12
@@ -189,7 +206,7 @@ RPM_LIST := \
189
206
libXi libXi-devel \
190
207
libXdmcp libXdmcp-devel \
191
208
libXau libXau-devel \
192
- libgcc \
209
+ libgcc libxcrypt \
193
210
zlib zlib-devel \
194
211
libffi libffi-devel \
195
212
fontconfig fontconfig-devel \
@@ -245,7 +262,7 @@ define Download
245
262
$$($(1)_CFG) : $$($(1)_FILE)
246
263
mkdir -p $$(SRCDIR)
247
264
tar -C $$(SRCDIR) -xf $$<
248
- $$(foreach p,$$(abspath $$(wildcard patches/$$(notdir $$($(1)_DIR)).patch)), \
265
+ $$(foreach p,$$(abspath $$(wildcard patches/$$(ARCH)-$$( notdir $$($(1)_DIR)).patch)), \
249
266
echo PATCHING $$(p) ; \
250
267
patch -d $$($(1)_DIR) -p1 -i $$(p) ; \
251
268
)
@@ -414,6 +431,12 @@ $(gcc) \
414
431
# wants.
415
432
$(BUILDDIR)/$(binutils_ver)/Makefile : CONFIG += --enable-64-bit-bfd --libdir=$(PREFIX)/$(word 1,$(LIBDIRS))
416
433
434
+ ifneq ($(ARCH), riscv64)
435
+ # gold is not available for riscv64 for some reason,
436
+ # and subsequent linking will fail if we try to enable it.
437
+ LINKER_CONFIG := --enable-gold=default
438
+ endif
439
+
417
440
# Makefile creation. Simply run configure in build dir.
418
441
# Setting CFLAGS to -O2 generates a much faster ld.
419
442
$(bfdmakes) \
@@ -426,11 +449,11 @@ $(BUILDDIR)/$(binutils_ver)/Makefile \
426
449
$(PATHPRE) $(ENVS) CFLAGS="-O2 $(CFLAGS)" \
427
450
$(BINUTILS_CFG) \
428
451
$(CONFIG) \
452
+ $(LINKER_CONFIG) \
429
453
--with-sysroot=$(SYSROOT) \
430
454
--disable-nls \
431
455
--program-prefix=$(TARGET)- \
432
456
--enable-multilib \
433
- --enable-gold=default \
434
457
--enable-threads \
435
458
--enable-plugins \
436
459
) > $(@D)/log.config 2>&1
@@ -494,7 +517,7 @@ ifeq ($(ARCH), armhfp)
494
517
$(BUILDDIR)/$(gcc_ver)/Makefile : CONFIG += --with-float=hard
495
518
endif
496
519
497
- ifneq ($(filter ppc64 ppc64le s390x, $(ARCH)), )
520
+ ifneq ($(filter riscv64 ppc64 ppc64le s390x, $(ARCH)), )
498
521
# We only support 64-bit on these platforms anyway
499
522
CONFIG += --disable-multilib
500
523
endif
0 commit comments