Skip to content

Instantly share code, notes, and snippets.

@ilikenwf
Created November 13, 2022 19:36
Show Gist options
  • Save ilikenwf/807d7b543972bc8e2b75ef94efaca870 to your computer and use it in GitHub Desktop.
Save ilikenwf/807d7b543972bc8e2b75ef94efaca870 to your computer and use it in GitHub Desktop.
Fix kodi crash on archlinux for iptvsimple addon
diff --git a/PKGBUILD b/PKGBUILD
index aedcd81..fe8d85c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -20,12 +20,17 @@ sha256sums=('57710d3add72301d47a9eef016916ee5f61b7b8604c73450d67b9ba962eff60c'
'cc026f59fd6e37ae90f3449df50810f1cefa37da9444e1188302d910518710da'
)
-#prepare() {
+prepare() {
#cd xbmc-${_kodiver}-${_koditarget}
#patch -p1 cmake/scripts/common/HandleDepends.cmake ${srcdir}/8f714dcc7f1a1dfa9b57ef18c3f4accc62cb0652.diff
#sed -i "s|-p1 -i|--binary -p1 -i|" cmake/scripts/common/HandleDepends.cmake
#sed -i 's/GIT_SHALLOW 1/GIT_SHALLOW ""/g' cmake/scripts/common/HandleDepends.cmake
-#}
+
+ # workaround fixes kodi crashes on arch - -Wp,-D_GLIBCXX_ASSERTIONS causes it!
+ export CPPFLAGS=$(echo $CPPFLAGS|sed -e 's/\-Wp\,\-D\_GLIBCXX\_ASSERTIONS//g')
+ export CXXFLAGS=$(echo $CXXFLAGS|sed -e 's/\-Wp\,\-D\_GLIBCXX\_ASSERTIONS//g')
+ export CFLAGS=$(echo $CFLAGS|sed -e 's/\-Wp\,\-D\_GLIBCXX\_ASSERTIONS//g')
+}
build() {
mkdir -p "${_gitname}-${pkgver}-${_koditarget}/build"
@ilikenwf
Copy link
Author

This merely hides again the code issue that GLIBCXX_ASSERTIONS uncovered.

It could be a false positive somehow as well...but I'm not personally concerned about issues between std::string and c_str if that is the issue.

@ilikenwf
Copy link
Author

@ghen2 Looking into it if it has anything to do with strings again, this is how the STR() macro is defined...

#include <string.h>

#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)

@ghen2
Copy link

ghen2 commented Nov 13, 2022

Btw this one-line suffices in build()

CXXFLAGS="$CXXFLAGS -Wp,-U_GLIBCXX_ASSERTIONS"

@ilikenwf
Copy link
Author

Nice, thanks - I tend to be in too many different worlds language wise to keep up or...remember everything I used to know...or do know...haha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment