From 8097af876d3d1c5a73a36e7792ceae7f8a19b765 Mon Sep 17 00:00:00 2001
From: Arnaud Fontaine <arnau@mini-dweeb.org>
Date: Thu, 17 Oct 2019 15:37:47 +0900
Subject: [PATCH] tp_smapi-lts-0.43-1.hyperbola40: thinkpad_ec module could not
 be loaded (FS#1317)

Patch from https://bugs.archlinux.org/task/54975
---
 tp_smapi-lts/PKGBUILD | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tp_smapi-lts/PKGBUILD b/tp_smapi-lts/PKGBUILD
index 132666a..1abd4ee 100644
--- a/tp_smapi-lts/PKGBUILD
+++ b/tp_smapi-lts/PKGBUILD
@@ -15,7 +15,7 @@ __pkgname=tp-smapi
 _pkgname=tp_smapi
 pkgname=${_pkgname}-lts
 pkgver=0.43
-pkgrel=1.hyperbola39
+pkgrel=1.hyperbola40
 _extramodules=extramodules-${_basekernel}-lts
 pkgdesc="Modules for ThinkPad's SMAPI functionality (built for the linux-libre-lts kernel package)"
 arch=('i686' 'x86_64')
@@ -42,7 +42,9 @@ build() {
 
   _kernver="$(cat /lib/modules/${_extramodules}/version)"
 
-  make HDAPS=1 KVER="${_kernver}" KBASE="/lib/modules/${_kernver}"
+  # https://bugs.archlinux.org/task/54975 (kernel has no _GLOBAL_OFFSET_TABLE_):
+  # Clear EXTRA_CFLAGS since it defaults to injecting CFLAGS and -fno-plt breaks the modules
+  make HDAPS=1 KVER="${_kernver}" KBASE="/lib/modules/${_kernver}" EXTRA_CFLAGS=
 }
 
 package() {
-- 
2.12.2

