File: cross.patch

package info (click to toggle)
picotool 2.2.0-a4%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,084 kB
  • sloc: cpp: 61,059; ansic: 2,999; asm: 2,048; perl: 219; sh: 212; python: 97; makefile: 41; xml: 18
file content (23 lines) | stat: -rw-r--r-- 1,001 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From: Johannes Schauer Marin Rodrigues <josch@debian.org>
Subject: unset CXXFLAGS, CFLAGS, CPPFLAGS

ExternalProject_Add() builds natively (ignoring CMAKE_CXX_COMPILER) but in this
case that's what we want because the otp_header_parse tool gets executed during
the build and does not get added to the binary package. But for the native
compiler to work, flags need to be unset as compilation will fail when
architecture-specific flags get passed (like -fcf-protection=full)

--- a/otp_header_parser/CMakeLists.txt
+++ b/otp_header_parser/CMakeLists.txt
@@ -1,3 +1,11 @@
+# otp_header_parse needs to be compiled a build-arch (native) tool and not for
+# the host architecture
+set(ENV{CC} ${CC_FOR_BUILD})
+set(ENV{CXX} ${CXX_FOR_BUILD})
+set(ENV{LDFLAGS} ${LDFLAGS_FOR_BUILD})
+set(ENV{CFLAGS} ${CFLAGS_FOR_BUILD} ${CPPFLAGS_FOR_BUILD})
+set(ENV{CXXFLAGS} ${CXXFLAGS_FOR_BUILD} ${CPPFLAGS_FOR_BUILD})
+
 cmake_minimum_required(VERSION 3.12)
 PROJECT(otp_header_parser CXX)
 set(CMAKE_CXX_STANDARD 14)