Makefile.include (1136fa0c07de570dc17858745af8be169d1440ba) Makefile.include (7fd9fd46a459272e641be78c1cc36baab1921fa1)
1# SPDX-License-Identifier: GPL-2.0
2ifneq ($(O),)
3ifeq ($(origin O), command line)
4 dummy := $(if $(shell cd $(PWD); test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
5 ABSOLUTE_O := $(shell cd $(PWD); cd $(O) ; pwd)
6 OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
7 COMMAND_O := O=$(ABSOLUTE_O)
8ifeq ($(objtree),)

--- 75 unchanged lines hidden (view full) ---

84LLVM_CONFIG ?= llvm-config
85LLVM_OBJCOPY ?= llvm-objcopy
86LLVM_STRIP ?= llvm-strip
87
88ifeq ($(CC_NO_CLANG), 1)
89EXTRA_WARNINGS += -Wstrict-aliasing=3
90
91else ifneq ($(CROSS_COMPILE),)
1# SPDX-License-Identifier: GPL-2.0
2ifneq ($(O),)
3ifeq ($(origin O), command line)
4 dummy := $(if $(shell cd $(PWD); test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
5 ABSOLUTE_O := $(shell cd $(PWD); cd $(O) ; pwd)
6 OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
7 COMMAND_O := O=$(ABSOLUTE_O)
8ifeq ($(objtree),)

--- 75 unchanged lines hidden (view full) ---

84LLVM_CONFIG ?= llvm-config
85LLVM_OBJCOPY ?= llvm-objcopy
86LLVM_STRIP ?= llvm-strip
87
88ifeq ($(CC_NO_CLANG), 1)
89EXTRA_WARNINGS += -Wstrict-aliasing=3
90
91else ifneq ($(CROSS_COMPILE),)
92# Allow userspace to override CLANG_CROSS_FLAGS to specify their own
93# sysroots and flags or to avoid the GCC call in pure Clang builds.
94ifeq ($(CLANG_CROSS_FLAGS),)
92CLANG_CROSS_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%))
93GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)gcc 2>/dev/null))
94ifneq ($(GCC_TOOLCHAIN_DIR),)
95CLANG_CROSS_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
96CLANG_CROSS_FLAGS += --sysroot=$(shell $(CROSS_COMPILE)gcc -print-sysroot)
97CLANG_CROSS_FLAGS += --gcc-toolchain=$(realpath $(GCC_TOOLCHAIN_DIR)/..)
98endif # GCC_TOOLCHAIN_DIR
95CLANG_CROSS_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%))
96GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)gcc 2>/dev/null))
97ifneq ($(GCC_TOOLCHAIN_DIR),)
98CLANG_CROSS_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
99CLANG_CROSS_FLAGS += --sysroot=$(shell $(CROSS_COMPILE)gcc -print-sysroot)
100CLANG_CROSS_FLAGS += --gcc-toolchain=$(realpath $(GCC_TOOLCHAIN_DIR)/..)
101endif # GCC_TOOLCHAIN_DIR
102endif # CLANG_CROSS_FLAGS
99CFLAGS += $(CLANG_CROSS_FLAGS)
100AFLAGS += $(CLANG_CROSS_FLAGS)
101endif # CROSS_COMPILE
102
103# Hack to avoid type-punned warnings on old systems such as RHEL5:
104# We should be changing CFLAGS and checking gcc version, but this
105# will do for now and keep the above -Wstrict-aliasing=3 in place
106# in newer systems.

--- 65 unchanged lines hidden ---
103CFLAGS += $(CLANG_CROSS_FLAGS)
104AFLAGS += $(CLANG_CROSS_FLAGS)
105endif # CROSS_COMPILE
106
107# Hack to avoid type-punned warnings on old systems such as RHEL5:
108# We should be changing CFLAGS and checking gcc version, but this
109# will do for now and keep the above -Wstrict-aliasing=3 in place
110# in newer systems.

--- 65 unchanged lines hidden ---