Files
openwrt/target/linux/generic/hack-6.18/200-tools_portability.patch
T
John Audia ddbf9c8557 kernel: bump 6.18 to 6.18.52
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.18.52

Removed upstreamed:
  linux/airoha/patches-6.18/109-02-v6.19-pinctrl-airoha-convert-PHY-LED-GPIO-to-macro.patch[1]
  linux/airoha/patches-6.18/109-03-v6.19-pinctrl-airoha-convert-PWM-GPIO-to-macro.patch[2]
  linux/airoha/patches-6.18/109-05-v6.19-pinctrl-airoha-add-support-for-Airoha-AN7583-PINs.patch[3]
  linux/airoha/patches-6.18/111-v6.19-wifi-mt76-Introduce-the-NPU-generic-layer.patch[4]
  linux/airoha/patches-6.18/113-v6.19-pinctrl-airoha-Fix-AIROHA_PINCTRL_CONFS_DRIVE_E2.patch[5]
  linux/airoha/patches-6.18/180-03-v7.2-pinctrl-airoha-an7583-add-missed-gpio32-pin-group.patch[6]
  linux/airoha/patches-6.18/180-05-v7.2-pinctrl-airoha-an7583-fix-misprint-in-gpio19-pinconf.patch[7]
  linux/airoha/patches-6.18/180-06-v7.2-pinctrl-airoha-an7581-fix-incorrect-led-mapping-in-p.patch[8]
  linux/airoha/patches-6.18/180-07-v7.2-pinctrl-airoha-an7583-fix-incorrect-led-mapping-in-p.patch[9]
  linux/airoha/patches-6.18/180-08-v7.2-pinctrl-airoha-fix-pwm-pin-function-for-an7581-and-a.patch[10]
  linux/airoha/patches-6.18/180-09-v7.2-pinctrl-airoha-an7583-fix-gpio21-pin-group.patch[11]
  linux/airoha/patches-6.18/180-10-v7.2-pinctrl-airoha-an7583-add-missed-gpio22-pin-group.patch[12]
  linux/airoha/patches-6.18/180-11-v7.2-pinctrl-airoha-an7583-fix-phy1_led1-pin-function.patch[13]
  linux/airoha/patches-6.18/180-12-v7.2-pinctrl-airoha-an7583-remove-undefined-groups-from-p.patch[14]
  linux/airoha/patches-6.18/202-01-v7.3-pinctrl-airoha-fix-mdio-bitfield-names.patch[15]
  linux/airoha/patches-6.18/202-02-v7.3-pinctrl-airoha-an7581-fix-pinconf-of-i2c_scl-i2c.patch[16]
  linux/airoha/patches-6.18/202-03-v7.3-pinctrl-airoha-an7583-fix-I2C0_SDA_PD-register-b.patch[17]
  linux/airoha/patches-6.18/202-04-v7.3-pinctrl-airoha-an7581-fix-mux-conf-of-pcie_reset.patch[18]
  linux/airoha/patches-6.18/202-05-v7.3-pinctrl-airoha-an7583-fix-muxing-of-non-gpio-def.patch[19]
  linux/airoha/patches-6.18/202-09-v7.3-pinctrl-airoha-an7583-fix-spi-group-pins.patch[20]
  linux/airoha/patches-6.18/202-10-v7.3-pinctrl-airoha-add-missed-get_direction-function.patch[21]
  linux/airoha/patches-6.18/202-13-v7.3-pinctrl-airoha-fix-getting-gpiochip-pinctrl-poin.patch[22]
  linux/airoha/patches-6.18/202-14-v7.3-pinctrl-airoha-add-missed-IRQ-resource-helpers.patch[23]
  linux/airoha/patches-6.18/202-15-v7.3-pinctrl-airoha-fix-IRQ-mask-unmask-code.patch[24]
  linux/airoha/patches-6.18/202-16-v7.3-pinctrl-airoha-fix-edge-triggered-interrupts-han.patch[25]
  linux/apm821xx/patches-6.18/100-powerpc-44x-Set-GPIO-chip-firmware-node.patch[26]
  linux/econet/patches-6.18/042-01-v6.19-pinctrl-airoha-convert-PHY-LED-GPIO-to-macro.patch[27]
  linux/econet/patches-6.18/042-02-v6.19-pinctrl-airoha-convert-PWM-GPIO-to-macro.patch[28]
  linux/econet/patches-6.18/042-03-v6.19-pinctrl-airoha-add-support-for-Airoha-AN7583-PINs.patch[29]
  linux/econet/patches-6.18/042-04-v6.19-pinctrl-airoha-Fix-AIROHA_PINCTRL_CONFS_DRIVE_E2.patch[30]
  linux/realtek/patches-6.18/032-01-v7.2-irqchip-irq-realtek-rtl-Add-simplify-register-helper.patch[31]
  linux/realtek/patches-6.18/032-02-v7.2-irqchip-irq-realtek-rtl-Add-multicore-support.patch[32]
  linux/realtek/patches-6.18/038-v7.3-irqchip-irq-realtek-rtl-change-to-__raw-reads-and-writes.patch[33]
  linux/econet/patches-6.18/043-03-v7.2-pinctrl-airoha-an7583-add-missed-gpio32-pin-group.patch[34]
  linux/econet/patches-6.18/043-04-v7.2-pinctrl-airoha-an7583-fix-misprint-in-gpio19-pinconf.patch[35]
  linux/econet/patches-6.18/043-05-v7.2-pinctrl-airoha-an7581-fix-incorrect-led-mapping-in-p.patch[36]
  linux/econet/patches-6.18/043-06-v7.2-pinctrl-airoha-an7583-fix-incorrect-led-mapping-in-p.patch[37]
  linux/econet/patches-6.18/043-07-v7.2-pinctrl-airoha-fix-pwm-pin-function-for-an7581-and-a.patch[38]
  linux/econet/patches-6.18/043-08-v7.2-pinctrl-airoha-an7583-fix-gpio21-pin-group.patch[39]
  linux/econet/patches-6.18/043-09-v7.2-pinctrl-airoha-an7583-add-missed-gpio22-pin-group.patch[40]
  linux/econet/patches-6.18/043-10-v7.2-pinctrl-airoha-an7583-fix-phy1_led1-pin-function.patch[41]
  linux/econet/patches-6.18/043-11-v7.2-pinctrl-airoha-an7583-remove-undefined-groups-from-p.patch[42]
  linux/econet/patches-6.18/044-01-v7.3-pinctrl-airoha-fix-mdio-bitfield-names.patch[43]
  linux/econet/patches-6.18/044-02-v7.3-pinctrl-airoha-an7581-fix-pinconf-of-i2c_scl-i2c.patch[44]
  linux/econet/patches-6.18/044-03-v7.3-pinctrl-airoha-an7583-fix-I2C0_SDA_PD-register-b.patch[45]
  linux/econet/patches-6.18/044-04-v7.3-pinctrl-airoha-an7581-fix-mux-conf-of-pcie_reset.patch[46]
  linux/econet/patches-6.18/044-05-v7.3-pinctrl-airoha-an7583-fix-muxing-of-non-gpio-def.patch[47]
  linux/econet/patches-6.18/044-09-v7.3-pinctrl-airoha-an7583-fix-spi-group-pins.patch[48]
  linux/econet/patches-6.18/044-10-v7.3-pinctrl-airoha-add-missed-get_direction-function.patch[49]
  linux/econet/patches-6.18/044-13-v7.3-pinctrl-airoha-fix-getting-gpiochip-pinctrl-poin.patch[50]
  linux/econet/patches-6.18/044-14-v7.3-pinctrl-airoha-add-missed-IRQ-resource-helpers.patch[51]
  linux/econet/patches-6.18/044-15-v7.3-pinctrl-airoha-fix-IRQ-mask-unmask-code.patch[52]
  linux/econet/patches-6.18/044-16-v7.3-pinctrl-airoha-fix-edge-triggered-interrupts-han.patch[53]
  linux/mvebu/patches-6.18/101-arm64-dts-armada-3720-turris-mox-fix-usb3-phys.patch[54]
  linux/qualcommax/patches-6.18/0085-v7.3-arm64-dts-qcom-ipq5018-Correct-CMN-PLL-reference-clock-rate.patch[55]
  linux/qualcommax/patches-6.18/0090-v7.3-arm64-qcom-ipq5018-Add-GEPHY-RX-and-TX-clocks.patch[56]
  linux/realtek/patches-6.18/032-04-v7.3-irqchip-irq-realtek-rtl-Add-interrupt-data-structure.patch[57]
  linux/realtek/patches-6.18/032-05-v7.3-irqchip-irq-realtek-rtl-Add-mask-for-interrupt-handl.patch[58]
  linux/realtek/patches-6.18/032-03-v7.3-irqchip-irq-realtek-rtl-Use-helper-for-parent-setup.patch[59]

Manually rebased:
  linux/generic/hack-6.18/200-tools_portability.patch
  linux/airoha/patches-6.18/180-01-v7.2-pinctrl-Move-Airoha-driver-to-dedicated-directory.patch
  linux/airoha/patches-6.18/202-17-v7.3-pinctrl-airoha-remove-not-needed-irq_type-array.patch
  linux/airoha/patches-6.18/402-01-thermal-airoha-convert-to-regmap-API.patch
  linux/econet/patches-6.18/043-02-v7.2-pinctrl-Move-Airoha-driver-to-dedicated-directory.patch
  linux/econet/patches-6.18/044-17-v7.3-pinctrl-airoha-remove-not-needed-irq_type-array.patch
  linux/mediatek/patches-6.18/361-clk-mediatek-add-clock-driver-for-mt7987-from-sdk.patch
  linux/octeon/patches-6.18/105-staging-octeon-support-EPROBE_DEFER-when-reading-MAC.patch
  linux/realtek/patches-6.18/032-06-v7.3-irqchip-irq-realtek-rtl-Add-a-select-function.patch
  linux/realtek/patches-6.18/032-07-v7.3-irqchip-irq-realtek-rtl-Allow-shuffled-interrupt-ord.patch

Dropped obsolete:
  linux/bcm27xx/patches-6.18/0082-added-capture_clear-option-to-pps-gpio-via-dtoverlay.patch

All other patches automatically rebased via update_kernel.sh

For target/linux/x86/generic/config-6.18, added new config option:
  # CONFIG_X86_AMD_PSTATE_DYNAMIC_EPP is not set

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=74c2c5b459b42e23e8b06e5685efb6a4ab39bea1
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=cfe4350fdcb53a31cb91faef26af200c6b8e18c7
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=4bf51df55d7bdbd5f6a694a54fc0a82e41df483a
4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=6e9207ac476ca50be95a552d1fc24dfa94a94266
5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=0ca274a45eaead8284fb86ebc1782b4488cfd072
6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=2e7c3c433fd791b95bc2264cab3c27f34e3b88b9
7. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=46bae3189cf5c4e37d72a542a717c52b579638c4
8. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=caf1e44e672b5c8751f7fbef1708204771d9bb8e
9. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=591424f9f5d51acde3ec478ea6c80ad20c6cec87
10. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=2ad214708259220add587f5a0bd3d7823fc3ed81
11. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=cf2e698957b65038ed0bfd27b95aa7baff3d3703
12. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=7bca33d6f6e00ea7f9c31bffbfecd4f2713fb2cb
13. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=6d0bcb2153128976038b61220a3297c80d273b22
14. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=5331bf0d5ca05e1d79386e41aeb9622e1a6cadf8
15. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=75ceddfa7df7ef1cee3f8d2b2095eb3b5f61a501
16. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=cbde1169bdd2cfda7b53f31bb0f6a32839c4d04e
17. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=fa27ddca660225863b3c301ad9f52b082af5bba6
18. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=2313f262999c72fbc940b3db9fa7e500ff9f7b96
19. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=38a2a4d6c7ac7d183a91f8d95a483884269b8059
20. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=7d2b3f8a996d1c3dceb95a10e766769f2951b92e
21. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=f3b8fe04dbfe3e9aaa00bd1febf2a6a1d600b79a
22. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=9ea692247ee2485e2fdd325bbe40d08fd0606a22
23. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=fda7350f257e59eee1bc7537c202e36bd56aea97
24. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=c7596135e7e9a77db9b34e61e24c7ac4562f88a3
25. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=244d0299008144e5c8f0c52cd23f85e4876ad993
26. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=7969b571ae940da0d429724a1a8ce141feda6583
27. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=74c2c5b459b42e23e8b06e5685efb6a4ab39bea1
28. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=cfe4350fdcb53a31cb91faef26af200c6b8e18c7
29. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=4bf51df55d7bdbd5f6a694a54fc0a82e41df483a
30. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=0ca274a45eaead8284fb86ebc1782b4488cfd072
31. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=a9be52993526640e99b5c49163e9efa9e7f4d93d
32. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=f7d818afcc22532cb9e854b204970a8d790576bf
33. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=5f02599590a4e4eb1dde3d17367b2b58dfe5ac4b
34. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=2e7c3c433fd791b95bc2264cab3c27f34e3b88b9
35. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=46bae3189cf5c4e37d72a542a717c52b579638c4
36. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=caf1e44e672b5c8751f7fbef1708204771d9bb8e
37. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=591424f9f5d51acde3ec478ea6c80ad20c6cec87
38. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=2ad214708259220add587f5a0bd3d7823fc3ed81
39. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=cf2e698957b65038ed0bfd27b95aa7baff3d3703
40. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=7bca33d6f6e00ea7f9c31bffbfecd4f2713fb2cb
41. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=6d0bcb2153128976038b61220a3297c80d273b22
42. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=5331bf0d5ca05e1d79386e41aeb9622e1a6cadf8
43. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=75ceddfa7df7ef1cee3f8d2b2095eb3b5f61a501
44. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=cbde1169bdd2cfda7b53f31bb0f6a32839c4d04e
45. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=fa27ddca660225863b3c301ad9f52b082af5bba6
46. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=2313f262999c72fbc940b3db9fa7e500ff9f7b96
47. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=38a2a4d6c7ac7d183a91f8d95a483884269b8059
48. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=7d2b3f8a996d1c3dceb95a10e766769f2951b92e
49. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=f3b8fe04dbfe3e9aaa00bd1febf2a6a1d600b79a
50. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=9ea692247ee2485e2fdd325bbe40d08fd0606a22
51. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=fda7350f257e59eee1bc7537c202e36bd56aea97
52. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=c7596135e7e9a77db9b34e61e24c7ac4562f88a3
53. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=244d0299008144e5c8f0c52cd23f85e4876ad993
54. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=19ebf0422fe916304220d33f701c5fd8ed7532da
55. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=c9fed0c7056c59294da36e05617ee8f6f629bf74
56. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=4e59a0b78e04884669ac22019a98f2112f834531
57. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=2aa9fcf31f3877311d90ed4519df999e6e684d31
58. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=5aa7bbe0bac89e7b127f0742e5536d02db491c74
59. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.52&id=421615e833d73b4c3bd49953a14fdfc5386c93b2

Build system: x86/64
Build-tested: x86/64-glibc
Run-tested: x86/64-glibc

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/24800
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-09-16 11:43:34 +02:00

164 lines
4.4 KiB
Diff

From a7ae4ed0a3951c45d4a59ee575951b64ae4a23fb Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@nbd.name>
Date: Tue, 7 May 2024 12:22:15 +0200
Subject: [PATCH] kernel: fix tools build breakage on macos with x86
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -93,13 +93,15 @@ $(call allow-override,LLVM_STRIP,llvm-st
endif
CC_NO_CLANG := $(shell $(CC) -dM -E -x c /dev/null | grep -Fq "__clang__"; echo $$?)
+HOSTCC_NO_CLANG := $(shell $(HOSTCC) -dM -E -x c /dev/null | grep -Fq "__clang__"; echo $$?)
# Some tools require bpftool
SYSTEM_BPFTOOL ?= bpftool
ifeq ($(CC_NO_CLANG), 1)
-EXTRA_WARNINGS += -Wstrict-aliasing=3
-
+ ifeq ($(HOSTCC_NO_CLANG), 1)
+ EXTRA_WARNINGS += -Wstrict-aliasing=3
+ endif
else ifneq ($(CROSS_COMPILE),)
# Allow userspace to override CLANG_CROSS_FLAGS to specify their own
# sysroots and flags or to avoid the GCC call in pure Clang builds.
--- a/tools/include/linux/types.h
+++ b/tools/include/linux/types.h
@@ -58,6 +58,7 @@ typedef unsigned long long ullong;
#define __user
#endif
#define __must_check
+#undef __cold
#define __cold
typedef __u16 __bitwise __le16;
--- a/tools/objtool/include/objtool/objtool.h
+++ b/tools/objtool/include/objtool/objtool.h
@@ -12,6 +12,7 @@
#include <objtool/elf.h>
+#undef __weak
#define __weak __attribute__((weak))
struct pv_state {
--- a/tools/include/asm-generic/bitops/fls.h
+++ b/tools/include/asm-generic/bitops/fls.h
@@ -2,6 +2,8 @@
#ifndef _ASM_GENERIC_BITOPS_FLS_H_
#define _ASM_GENERIC_BITOPS_FLS_H_
+#include <string.h>
+
/**
* generic_fls - find last (most-significant) bit set
* @x: the word to search
@@ -10,6 +12,7 @@
* Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
*/
+#define generic_fls __linux_fls
static __always_inline __attribute_const__ int generic_fls(unsigned int x)
{
int r = 32;
--- a/tools/lib/string.c
+++ b/tools/lib/string.c
@@ -96,6 +96,7 @@ int strtobool(const char *s, bool *res)
* If libc has strlcpy() then that version will override this
* implementation:
*/
+#ifndef __APPLE__
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wignored-attributes"
@@ -114,6 +115,7 @@ size_t __weak strlcpy(char *dest, const
#ifdef __clang__
#pragma clang diagnostic pop
#endif
+#endif
/**
* skip_spaces - Removes leading whitespace from @str.
--- a/tools/arch/x86/include/asm/insn.h
+++ b/tools/arch/x86/include/asm/insn.h
@@ -7,7 +7,7 @@
* Copyright (C) IBM Corporation, 2009
*/
-#include <asm/byteorder.h>
+#include <linux/kernel.h>
/* insn_attr_t is defined in inat.h */
#include "inat.h" /* __ignore_sync_check__ */
--- a/tools/arch/x86/include/asm/orc_types.h
+++ b/tools/arch/x86/include/asm/orc_types.h
@@ -46,7 +46,17 @@
#define ORC_TYPE_REGS_PARTIAL 4
#ifndef __ASSEMBLER__
+#ifdef __APPLE__
+#include <endian.h>
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN_BITFIELD
+#elif __BYTE_ORDER == __BIG_ENDIAN
+#define __BIG_ENDIAN_BITFIELD
+#endif
+#else
#include <asm/byteorder.h>
+#endif
/*
* This struct is more or less a vastly simplified version of the DWARF Call
--- a/tools/include/linux/rbtree.h
+++ b/tools/include/linux/rbtree.h
@@ -18,7 +18,6 @@
#define __TOOLS_LINUX_PERF_RBTREE_H
#include <linux/kernel.h>
-#include <linux/stddef.h>
struct rb_node {
unsigned long __rb_parent_color;
--- a/tools/lib/subcmd/exec-cmd.c
+++ b/tools/lib/subcmd/exec-cmd.c
@@ -12,7 +12,10 @@
#include "subcmd-config.h"
#define MAX_ARGS 32
+
+#ifndef PATH_MAX
#define PATH_MAX 4096
+#endif
static const char *argv_exec_path;
static const char *argv0_path;
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -42,6 +42,8 @@ OBJTOOL_LDFLAGS := $(LIBELF_LIBS) $(LIBS
elfshdr := $(shell echo '$(pound)include <libelf.h>' | $(HOSTCC) $(OBJTOOL_CFLAGS) -x c -E - 2>/dev/null | grep elf_getshdr)
OBJTOOL_CFLAGS += $(if $(elfshdr),,-DLIBELF_USE_DEPRECATED)
+OBJTOOL_CFLAGS += $(HOST_EXTRACFLAGS)
+
# Always want host compilation.
HOST_OVERRIDES := CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)"
--- a/tools/arch/x86/lib/insn.c
+++ b/tools/arch/x86/lib/insn.c
@@ -15,7 +15,11 @@
#include "../include/asm/insn.h" /* __ignore_sync_check__ */
#include <linux/unaligned.h> /* __ignore_sync_check__ */
+#ifdef __KERNEL__
#include <linux/errno.h>
+#else
+#include <errno.h>
+#endif
#include <linux/kconfig.h>
#include "../include/asm/emulate_prefix.h" /* __ignore_sync_check__ */