enable cross compilation for RHEL7-x86_64 and nilrt7-armv7a on RHEL8 (using mounted SYSROOT at /opt/RHEL7)
This commit is contained in:
21
configure/os/CONFIG.Cross_64.RHEL7-x86_64
Normal file
21
configure/os/CONFIG.Cross_64.RHEL7-x86_64
Normal file
@@ -0,0 +1,21 @@
|
||||
# "cross compile" for RHEL7-x86_64 on other 64 bit Linux version
|
||||
# Expects RHEL7 RPMs c++ and readline-devel installed in $(SYSROOT)
|
||||
# This can be installed on RHEL7 with:
|
||||
# yum install --installroot=$(SYSROOT) <packages>
|
||||
# (Assuming $(SYSROOT) is on a shared network volume.)
|
||||
# Optionally use a newer toolset (installed on $(SYSROOT)).
|
||||
|
||||
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86
|
||||
|
||||
SYSROOT = /opt/RHEL7
|
||||
TOOLSET_LOCATION = /opt/rh
|
||||
|
||||
# Do NOT set GNU_BIN (or else ...)!
|
||||
TOOLSET_DIR = $(TOOLSET:%=$(TOOLSET_LOCATION)/%/root)
|
||||
CC = $(SYSROOT)$(TOOLSET_DIR)/bin/gcc
|
||||
CCC = $(SYSROOT)$(TOOLSET_DIR)/bin/g++
|
||||
# Set LD_LIBRARY_PATH and BFLAG only with TOOLSET
|
||||
LD_LIBRARY_PATH = $(if $(TOOLSET),$(SYSROOT)$(TOOLSET_DIR)/lib64)
|
||||
BFLAG = $(if $(TOOLSET),-B$(SYSROOT)$(TOOLSET_DIR)/bin)
|
||||
TARGET_CPPFLAGS += --sysroot=$(SYSROOT) $(BFLAG)
|
||||
TARGET_LDFLAGS += --sysroot=$(SYSROOT) $(BFLAG)
|
||||
4
configure/os/CONFIG.RHEL8-x86_64.RHEL7-x86_64
Normal file
4
configure/os/CONFIG.RHEL8-x86_64.RHEL7-x86_64
Normal file
@@ -0,0 +1,4 @@
|
||||
include $(CONFIG)/os/CONFIG.Cross_64.RHEL7-x86_64
|
||||
|
||||
#TOOLSET = devtoolset-11
|
||||
#STD_CXXFLAGS = -std=c++17
|
||||
@@ -4,5 +4,5 @@ include $(CONFIG)/os/CONFIG.linux-x86.linux-x86
|
||||
# Use gcc 11 from gcc-toolset-11
|
||||
GNU_BIN = /opt/rh/gcc-toolset-11/root/usr/bin
|
||||
# Fix bug in gcc-toolset-11 calling the old assembler
|
||||
TARGET_CFLAGS = -B$(GNU_BIN)
|
||||
TARGET_CFLAGS += -B$(GNU_BIN)
|
||||
STD_CXXFLAGS = -std=c++17
|
||||
|
||||
1
configure/os/CONFIG.RHEL8-x86_64.nilrt7-armv7a
Normal file
1
configure/os/CONFIG.RHEL8-x86_64.nilrt7-armv7a
Normal file
@@ -0,0 +1 @@
|
||||
GNU_BIN=/opt/RHEL7/bin
|
||||
@@ -4,9 +4,8 @@ include $(CONFIG)/os/CONFIG_SITE.linux-x86_64.Common
|
||||
CROSS_COMPILER_TARGET_ARCHS += RHEL8-x86_64-clang
|
||||
|
||||
# Build for old RHEL7 64 bit
|
||||
#CROSS_COMPILER_TARGET_ARCHS += RHEL7-x86_64
|
||||
CROSS_COMPILER_TARGET_ARCHS += RHEL7-x86_64
|
||||
|
||||
# NI Linux Real-Time 7.x
|
||||
# requires RPM gcc-c++-arm-linux-gnu
|
||||
# not available yet for RHEL8
|
||||
#CROSS_COMPILER_TARGET_ARCHS += nilrt7-armv7a
|
||||
CROSS_COMPILER_TARGET_ARCHS += nilrt7-armv7a
|
||||
|
||||
Reference in New Issue
Block a user