Solved building kodi with clang/LTO unavailable... is there an internal switch?
#46
https://github.com/xbmc/xbmc/pull/19892
Reply
#47
(2021-06-18, 06:12)wsnipex Wrote: thanks for testing.
btw, installing ccache and moving the lto cache to upside of the build dir(I assume you always do a clean build) should help a lot.

Yes, no ccache.  What did you mean by "moving the lto cache to upside of the build dir?"
Need help programming a Streamzap remote?
Reply
#48
Also, applying the PR to Matrix ended in failure whereas using your previous commits to Matrix, worked.  Building your branch as-is now (not trying to patch on Matrix):

Code:
...
[ 93%] Generating AddonModuleXbmcwsgi.i.cpp
[ 93%] Generating AddonModuleXbmc.i.cpp
Caught: java.lang.reflect.InaccessibleObjectException: Unable to make field protected transient int java.util.AbstractList.modCount accessible: module java.base does not "opens java.util" to unnamed module @17579e0f
java.lang.reflect.InaccessibleObjectException: Unable to make field protected transient int java.util.AbstractList.modCount accessible: module java.base does not "opens java.util" to unnamed module @17579e0f
    at Generator$_run_closure1.doCall(Generator.groovy:43)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at Generator.run(Generator.groovy:39)
make[2]: *** [build/swig/CMakeFiles/python_binding.dir/build.make:118: build/swig/AddonModuleXbmcwsgi.i.cpp] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 93%] Building CXX object build/network/httprequesthandler/CMakeFiles/network_httprequesthandlers.dir/HTTPFileHandler.cpp.o
[ 93%] Building CXX object build/network/httprequesthandler/CMakeFiles/network_httprequesthandlers.dir/HTTPImageHandler.cpp.o
Caught: java.lang.reflect.InaccessibleObjectException: Unable to make field protected transient int java.util.AbstractList.modCount accessible: module java.base does not "opens java.util" to unnamed module @4b1c1ea0
java.lang.reflect.InaccessibleObjectException: Unable to make field protected transient int java.util.AbstractList.modCount accessible: module java.base does not "opens java.util" to unnamed module @4b1c1ea0
    at Generator$_run_closure1.doCall(Generator.groovy:43)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at Generator.run(Generator.groovy:39)
make[2]: *** [build/swig/CMakeFiles/python_binding.dir/build.make:97: build/swig/AddonModuleXbmc.i.cpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:10612: build/swig/CMakeFiles/python_binding.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Complete build log: https://gist.github.com/graysky2/0d66acc...f0e6e25ef8
Need help programming a Streamzap remote?
Reply
#49
for matrix, you need https://github.com/xbmc/xbmc/pull/19891 as well.
Reply
#50
(2021-06-18, 21:32)wsnipex Wrote: for matrix, you need https://github.com/xbmc/xbmc/pull/19891 as well.

Gotcha, I will try it, thanks.
Need help programming a Streamzap remote?
Reply
#51
I have been trying to build under arch, but no luck. I've applied the changes in #19891 and from here to my CMake.txt:
Quote:function(generate_file file)
  set(classpath ${GROOVY_DIR}/groovy-all-${GROOVY_VER}.jar
                ${GROOVY_DIR}/commons-lang-${COMMONS_VER}.jar
                ${CMAKE_SOURCE_DIR}/tools/codegenerator
                ${CMAKE_CURRENT_SOURCE_DIR}/../python)
  if(NOT CORE_SYSTEM_NAME STREQUAL windows AND NOT CORE_SYSTEM_NAME STREQUAL windowsstore)
    set(devnull "/dev/null")
    string(REPLACE ";" ":" classpath "${classpath}")
  else()
    set(devnull "nul")
  endif()

  set(CPP_FILE ${file}.cpp)
  if(CLANGFORMAT_FOUND)
    set(CLANG_FORMAT_COMMAND COMMAND ${CLANG_FORMAT_EXECUTABLE} ARGS -i ${CPP_FILE})
  endif()
  
  if(Java_VERSION_MAJOR GREATER 8)
    set(JAVA_OPEN_OPTS --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.regex=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED  --add-opens java.base/java.net=ALL-UNNAMED)
  endif()

  add_custom_command(OUTPUT ${CPP_FILE}
                     COMMAND ${SWIG_EXECUTABLE}
                     ARGS -w401 -c++ -o ${file}.xml -xml -I${CMAKE_SOURCE_DIR}/xbmc -xmllang python ${CMAKE_CURRENT_SOURCE_DIR}/../swig/${file}
                     COMMAND ${Java_JAVA_EXECUTABLE}
                     ARGS ${JAVA_OPEN_OPTS} -cp "${classpath}" groovy.ui.GroovyMain ${CMAKE_SOURCE_DIR}/tools/codegenerator/Generator.groovy ${file}.xml ${CMAKE_CURRENT_SOURCE_DIR}/../python/PythonSwig.cpp.template ${file}.cpp > ${devnull}
                     ${CLANG_FORMAT_COMMAND}
                     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../swig/${file} ${CMAKE_CURRENT_SOURCE_DIR}/../python/PythonSwig.cpp.template)
  set(SOURCES ${SOURCES} "${CPP_FILE}" PARENT_SCOPE)
endfunction()

find_package(Java COMPONENTS Runtime REQUIRED)
find_package(SWIG REQUIRED)

# The generated bindings
set(INPUTS AddonModuleXbmcaddon.i
           AddonModuleXbmcdrm.i
           AddonModuleXbmcgui.i
           AddonModuleXbmc.i
           AddonModuleXbmcplugin.i
           AddonModuleXbmcvfs.i
           AddonModuleXbmcwsgi.i)

set(GROOVY_DIR ${CMAKE_SOURCE_DIR}/tools/codegenerator/groovy)
set(GROOVY_VER 2.4.4)
set(COMMONS_VER 2.6)

foreach(INPUT IN LISTS INPUTS)
  generate_file(${INPUT})
  list(APPEND GEN_SRCS ${CMAKE_CURRENT_BINARY_DIR}/${INPUT}.cpp)
endforeach()

add_library(python_binding STATIC ${SOURCES})
set_target_properties(python_binding PROPERTIES POSITION_INDEPENDENT_CODE TRUE
                                                FOLDER "Build Utilities")
set(core_DEPENDS python_binding ${core_DEPENDS} CACHE STRING "" FORCE)
add_dependencies(python_binding ${GLOBAL_TARGET_DEPS})

if(CORE_SYSTEM_NAME STREQUAL windowsstore)
  set_target_properties(python_binding PROPERTIES STATIC_LIBRARY_FLAGS "/ignore:4264")
endif()

But when I run makepkg I get this error.
Quote:Generating AddonModuleXbmcwsgi.i.cpp
Caught: java.lang.reflect.InaccessibleObjectException: Unable to make field protected transient int java.util.AbstractList.modCount accessible: module java.base does not "opens java.util" to unnamed module @1b68ddbd
java.lang.reflect.InaccessibleObjectException: Unable to make field protected transient int java.util.AbstractList.modCount accessible: module java.base does not "opens java.util" to unnamed module @1b68ddbd
    at Generator$_run_closure1.doCall(Generator.groovy:43)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at Generator.run(Generator.groovy:39)
make[2]: *** [build/swig/CMakeFiles/python_binding.dir/build.make:112: build/swig/AddonModuleXbmcwsgi.i.cpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:10815: build/swig/CMakeFiles/python_binding.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
What am I doing wrong ? Thank you.
Reply
#52
Not sure, try either of these PKGBUILDs from AUR.  Works for me.  Treat it as a guide once you verified it works for you to figure out what's wrong.

kodi-git
kodi-git-matrix
Need help programming a Streamzap remote?
Reply
#53
(2021-06-30, 14:15)graysky Wrote: Not sure, try either of these PKGBUILDs from AUR.  Works for me.  Treat it as a guide once you verified it works for you to figure out what's wrong.

kodi-git
kodi-git-matrix

Not sure I understand, I thought this was an issue with Java and therefore mods to CMakeLists.txt were required. How does the PKGBUILD come into this ? Thanks.

(Sorry, this is kind of new territory for me, I don't have a lot of experience with building packages and modifying PKGBUILDs)
Reply
#54
Highly recommend you build on Arch using PKGBUILDs and not by hand.  They guarantee consistency and reproducible and help you minimize errors.  They are basically bash scripts that makepkg uses so if you're comfortable on the shell, it should be a natural transition.  See: https://wiki.archlinux.org/title/Develop...ean_chroot and https://aur.archlinux.org/packages/clean...t-manager/
Need help programming a Streamzap remote?
Reply
#55
(2021-06-30, 14:15)graysky Wrote: Not sure, try either of these PKGBUILDs from AUR.  Works for me.  Treat it as a guide once you verified it works for you to figure out what's wrong.

kodi-git
kodi-git-matrix

Ok, tried the matrix package from the AUR and got the same error:
Quote: Generating AddonModuleXbmcwsgi.i.cpp
Caught: java.lang.reflect.InaccessibleObjectException: Unable to make field protected transient int java.util.AbstractList.modCount accessible: module java.base does not "opens java.util" to unnamed module @1b68ddbd
java.lang.reflect.InaccessibleObjectException: Unable to make field protected transient int java.util.AbstractList.modCount accessible: module java.base does not "opens java.util" to unnamed module @1b68ddbd
    at Generator$_run_closure1.doCall(Generator.groovy:43)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at Generator.run(Generator.groovy:39)
make[2]: *** [build/swig/CMakeFiles/python_binding.dir/build.make:112: build/swig/AddonModuleXbmcwsgi.i.cpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:10995: build/swig/CMakeFiles/python_binding.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
Will try this one next: https://aur.archlinux.org/packages/kodi-git-x11/
Reply
#56
Wait... I think we need to apply the java 9 fix to matrix which I am not currently doing in that PKGBUILD.  I will test first to be sure.  Stay tuned.

EDIT: Yes, that was the problem, you need the PR not yet merged.  See the latest version of the PKGBUILDs.
Need help programming a Streamzap remote?
Reply
#57
(2021-07-01, 17:52)graysky Wrote: Wait... I think we need to apply the java 9 fix to matrix which I am not currently doing in that PKGBUILD.  I will test first to be sure.  Stay tuned.

EDIT: Yes, that was the problem, you need the PR not yet merged.  See the latest version of the PKGBUILDs.
Still no luck, although the problem seems to be a different one. I commented out the wayland and gbm sections as I don't need them, ran makepkg and now I get this:
Quote:
Code:
[100%] Built target pack-skins
[100%] Building CXX object CMakeFiles/kodi.dir/xbmc/platform/posix/main.cpp.o
[100%] Linking CXX executable kodi-x11
/home/laffi/pkg/kodi-matrix-git/src/xbmc/xbmc/playlists/SmartPlayList.cpp:46: warning: type 'struct translateField' violates the C++ One Definition Rule [-Wodr]
   46 | } translateField;
      | 
/home/laffi/pkg/kodi-matrix-git/src/xbmc/xbmc/TextureDatabase.cpp:41: note: a different type is defined in another translation unit
   41 | } translateField;
      | 
/home/laffi/pkg/kodi-matrix-git/src/xbmc/xbmc/playlists/SmartPlayList.cpp:40: note: the first difference of corresponding definitions is field 'string'
   40 |   char string[17];
      | 
/home/laffi/pkg/kodi-matrix-git/src/xbmc/xbmc/TextureDatabase.cpp:36: note: a field of same name but different type is defined in another translation unit
   36 |   char string[14];
      | 
/home/laffi/pkg/kodi-matrix-git/src/xbmc/xbmc/playlists/SmartPlayList.cpp:46: note: array types have different bounds
   46 | } translateField;
      | 
collect2: fatal error: ld terminated with signal 9 [Killed]
compilation terminated.
make[2]: *** [CMakeFiles/kodi.dir/build.make:554: kodi-x11] Error 1
make[2]: *** Deleting file 'kodi-x11'
make[1]: *** [CMakeFiles/Makefile2:4203: CMakeFiles/kodi.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
[laffi@frontend kodi-matrix-git]$ /home/laffi/pkg/kodi-matrix-git/src/xbmc/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.cpp:2848: warning: type 'OUTPUT_STATES' violates the C++ One Definition Rule [-Wodr]
 2848 | enum OUTPUT_STATES
      | 
/home/laffi/pkg/kodi-matrix-git/src/xbmc/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp:1502: note: an enum with different number of values is defined in another translation unit
 1502 | enum OUTPUT_STATES
      | 
/home/laffi/pkg/kodi-matrix-git/src/xbmc/lib/libUPnP/Neptune/Source/Core/NptXml.h:140: warning: type 'NPT_XmlNode::Type' violates the C++ One Definition Rule [-Wodr]
  140 |     } Type;
      | 
/home/laffi/pkg/kodi-matrix-git/src/xbmc/lib/libUPnP/Neptune/Source/Core/NptXml.h:140: note: an enum with different value name is defined in another translation unit
  140 |     } Type;
      | 
/home/laffi/pkg/kodi-matrix-git/src/xbmc/lib/libUPnP/Neptune/Source/Core/NptXml.h:139: note: name 'TEXT' differs from name 'TINYXML_TEXT' defined in another translation unit
  139 |         TEXT
      | 
/home/laffi/pkg/kodi-matrix-git/src/xbmc/lib/libUPnP/Neptune/Source/Core/NptXml.h:139: note: mismatching definition
  139 |         TEXT
      | 



which seems to be related to memory or CPU issues. Not yet sure how to address that.
Reply
#58
Add more swap or disable LTO: (-DUSE_LTO=OFF)
Need help programming a Streamzap remote?
Reply
#59
(2021-07-02, 12:18)graysky Wrote: Add more swap or disable LTO: (-DUSE_LTO=OFF)

Thanks. I created a 16G swapfile and started again. Unfortunately it always takes a few hours on my machine to get to the stage were it aborted previously. Let's see how we go.
Reply
#60
Success.

I managed to build and install the package and now have hardware acceleration again.

Only issue was that when I tried to build the kodi-addon-pvr-mythtv package it was complaining about missing dependencies, namely kodi-dev, kodi-platform and kodi-common.
I installed kodi-dev from the package I built, kodi-platform from the official repos and commented out the dependency for kodi-common, since I figured it was there but was obviously not being recognised. Bit messy, but it works.

I still do not understand how I would need to modify the PKGBUILD from the official repos and tell it to use the modified CMakelists.txt though.
Reply

Logout Mark Read Team Forum Stats Members Help
building kodi with clang/LTO unavailable... is there an internal switch?0