This patch eliminates aarch64 gcc and boost libraries from externals
in lieu of new mechanism to download the packages from Fedora
repository.

Fixes #743

Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com>
---
 .gitignore                |  1 +
 .gitmodules               |  6 ----
 Makefile                  | 60 +++++++++++++--------------------------
 external/aarch64/gcc.bin  |  1 -
 external/aarch64/misc.bin |  1 -
 5 files changed, 21 insertions(+), 48 deletions(-)
 delete mode 160000 external/aarch64/gcc.bin
 delete mode 160000 external/aarch64/misc.bin

diff --git a/.gitignore b/.gitignore
index 16e192db..398c5de7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -49,3 +49,4 @@ modules/libyaml/usr.manifest
 modules/dl_tests/usr.manifest
 .idea
 compile_commands.json
+downloaded_packages
diff --git a/.gitmodules b/.gitmodules
index da6d5d62..b6ae6ac1 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -6,12 +6,6 @@
        path = apps
        url = ../../cloudius-systems/osv-apps
        ignore = dirty
-[submodule "external/aarch64/gcc.bin"]
-       path = external/aarch64/gcc.bin
-       url = ../../cloudius-systems/aarch64-gcc.bin.git
-[submodule "external/aarch64/misc.bin"]
-       path = external/aarch64/misc.bin
-       url = ../../cloudius-systems/aarch64-misc.bin.git
 [submodule "modules/httpserver/swagger-ui"]
        path = modules/httpserver-html5-gui/swagger-ui
        url = ../../cloudius-systems/swagger-ui.git
diff --git a/Makefile b/Makefile
index 0e5d4d32..e8e110a5 100644
--- a/Makefile
+++ b/Makefile
@@ -205,34 +205,16 @@ cscope:
 
 ###########################################################################
 
-
-# The user can override the build_env variable (or one or more of *_env
-# variables below) to decide if to take the host's C/C++ libraries, or
-# those from the external/ directory.
-build_env ?= $(if $(filter $(host_arch), $(arch)),host,external)
-ifeq ($(build_env), host)
-    gcc_lib_env ?= host
-    cxx_lib_env ?= host
-    gcc_include_env ?= host
-    boost_env ?= host
-else
-    gcc_lib_env ?= external
-    cxx_lib_env ?= external
-    gcc_include_env ?= external
-    boost_env ?= external
-endif
-
-
 local-includes =
 INCLUDES = $(local-includes) -Iarch/$(arch) -I. -Iinclude  -Iarch/common
 INCLUDES += -isystem include/glibc-compat
 
-gccbase = external/$(arch)/gcc.bin
-miscbase = external/$(arch)/misc.bin
+aarch64_gccbase = downloaded_packages/aarch64/gcc/install
+aarch64_boostbase = downloaded_packages/aarch64/boost/install
 
-ifeq ($(gcc_include_env), external)
-  gcc-inc-base := $(dir $(shell find $(gccbase)/ -name vector | grep -v -e 
debug/vector$$ -e profile/vector$$))
-  gcc-inc-base3 := $(dir $(shell dirname `find $(gccbase)/ -name c++config.h | 
grep -v /32/`))
+ifeq ($(arch),aarch64)
+  gcc-inc-base := $(dir $(shell find $(aarch64_gccbase)/ -name vector | grep 
-v -e debug/vector$$ -e profile/vector$$ -e experimental/vector$$))
+  gcc-inc-base3 := $(dir $(shell dirname `find $(aarch64_gccbase)/ -name 
c++config.h | grep -v /32/`))
   INCLUDES += -isystem $(gcc-inc-base)
   INCLUDES += -isystem $(gcc-inc-base3)
 endif
@@ -247,7 +229,7 @@ INCLUDES += -isystem $(libfdt_base)
 endif
 
 INCLUDES += $(boost-includes)
-ifeq ($(gcc_include_env), host)
+ifeq ($(arch),x64)
 # Starting in Gcc 6, the standard C++ header files (which we do not change)
 # must precede in the include path the C header files (which we replace).
 # This is explained in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70722.
@@ -257,8 +239,8 @@ INCLUDES += $(shell $(CXX) -E -xc++ - -v </dev/null 2>&1 | 
awk '/^End/ {exit} /^
 endif
 INCLUDES += -isystem include/api
 INCLUDES += -isystem include/api/$(arch)
-ifeq ($(gcc_include_env), external)
-  gcc-inc-base2 := $(dir $(shell find $(gccbase)/ -name unwind.h))
+ifeq ($(arch),aarch64)
+  gcc-inc-base2 := $(dir $(shell find $(aarch64_gccbase)/ -name unwind.h))
   # must be after include/api, since it includes some libc-style headers:
   INCLUDES += -isystem $(gcc-inc-base2)
 endif
@@ -289,7 +271,7 @@ $(out)/musl/%.o: source-dialects =
 
 kernel-defines = -D_KERNEL $(source-dialects)
 
-gcc-sysroot = $(if $(CROSS_PREFIX), --sysroot external/$(arch)/gcc.bin) \
+gcc-sysroot = $(if $(CROSS_PREFIX), --sysroot $(aarch64_gccbase)) \
 
 # This play the same role as "_KERNEL", but _KERNEL unfortunately is too
 # overloaded. A lot of files will expect it to be set no matter what, specially
@@ -314,11 +296,9 @@ COMMON = $(autodepend) -g -Wall -Wno-pointer-arith 
$(CFLAGS_WERROR) -Wformat=0 -
        -include compiler/include/intrinsics.hh \
        $(arch-cflags) $(conf-opt) $(acpi-defines) $(tracing-flags) 
$(gcc-sysroot) \
        $(configuration) -D__OSV__ -D__XEN_INTERFACE_VERSION__="0x00030207" 
-DARCH_STRING=$(ARCH_STR) $(EXTRA_FLAGS)
-ifeq ($(gcc_include_env), external)
-ifeq ($(boost_env), external)
+ifeq ($(arch),aarch64)
   COMMON += -nostdinc
 endif
-endif
 
 tracing-flags-0 =
 tracing-flags-1 = -finstrument-functions 
-finstrument-functions-exclude-file-list=c++,trace.cc,trace.hh,align.hh,mmintrin.h
@@ -1807,7 +1787,7 @@ objects += $(addprefix fs/, $(fs_objs))
 objects += $(addprefix libc/, $(libc))
 objects += $(addprefix musl/src/, $(musl))
 
-ifeq ($(cxx_lib_env), host)
+ifeq ($(arch),x64)
     libstdc++.a := $(shell $(CXX) -print-file-name=libstdc++.a)
     ifeq ($(filter /%,$(libstdc++.a)),)
         $(error Error: libstdc++.a needs to be installed.)
@@ -1818,11 +1798,11 @@ ifeq ($(cxx_lib_env), host)
         $(error Error: libsupc++.a needs to be installed.)
     endif
 else
-    libstdc++.a := $(shell find $(gccbase)/ -name libstdc++.a)
-    libsupc++.a := $(shell find $(gccbase)/ -name libsupc++.a)
+    libstdc++.a := $(shell find $(aarch64_gccbase)/ -name libstdc++.a)
+    libsupc++.a := $(shell find $(aarch64_gccbase)/ -name libsupc++.a)
 endif
 
-ifeq ($(gcc_lib_env), host)
+ifeq ($(arch),x64)
     libgcc.a := $(shell $(CC) -print-libgcc-file-name)
     ifeq ($(filter /%,$(libgcc.a)),)
         $(error Error: libgcc.a needs to be installed.)
@@ -1833,11 +1813,11 @@ ifeq ($(gcc_lib_env), host)
         $(error Error: libgcc_eh.a needs to be installed.)
     endif
 else
-    libgcc.a := $(shell find $(gccbase)/ -name libgcc.a |  grep -v /32/)
-    libgcc_eh.a := $(shell find $(gccbase)/ -name libgcc_eh.a |  grep -v /32/)
+    libgcc.a := $(shell find $(aarch64_gccbase)/ -name libgcc.a |  grep -v 
/32/)
+    libgcc_eh.a := $(shell find $(aarch64_gccbase)/ -name libgcc_eh.a |  grep 
-v /32/)
 endif
 
-ifeq ($(boost_env), host)
+ifeq ($(arch),x64)
     # link with -mt if present, else the base version (and hope it is 
multithreaded)
     boost-mt := -mt
     boost-lib-dir := $(dir $(shell $(CC) --print-file-name 
libboost_system$(boost-mt).a))
@@ -1853,9 +1833,9 @@ ifeq ($(boost_env), host)
     # special for Boost.
     boost-includes =
 else
-    boost-lib-dir := $(firstword $(dir $(shell find $(miscbase)/ -name 
libboost_system*.a)))
+    boost-lib-dir := $(firstword $(dir $(shell find $(aarch64_boostbase)/ 
-name libboost_system*.a)))
     boost-mt := $(if $(filter %-mt.a, $(wildcard $(boost-lib-dir)/*.a)),-mt)
-    boost-includes = -isystem $(miscbase)/usr/include
+    boost-includes = -isystem $(aarch64_boostbase)/usr/include
 endif
 
 boost-libs := $(boost-lib-dir)/libboost_system$(boost-mt).a
@@ -1931,7 +1911,7 @@ $(bootfs_manifest_dep): phony
 ifeq ($(arch),x64)
 libgcc_s_dir := $(dir $(shell $(CC) -print-file-name=libgcc_s.so.1))
 else
-libgcc_s_dir := ../../$(gccbase)/lib64
+libgcc_s_dir := ../../$(aarch64_gccbase)/lib64
 endif
 
 $(out)/bootfs.bin: scripts/mkbootfs.py $(bootfs_manifest) 
$(bootfs_manifest_dep) $(tools:%=$(out)/%) \
diff --git a/external/aarch64/gcc.bin b/external/aarch64/gcc.bin
deleted file mode 160000
index a85ead11..00000000
--- a/external/aarch64/gcc.bin
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit a85ead11151e18075153f44fa685757dbc6e9675
diff --git a/external/aarch64/misc.bin b/external/aarch64/misc.bin
deleted file mode 160000
index a51b8f09..00000000
--- a/external/aarch64/misc.bin
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit a51b8f093574bedc4a361da7b155515ca473774c
-- 
2.20.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/20200225055252.6672-3-jwkozaczuk%40gmail.com.

Reply via email to