Issues building CoreELEC from source

Ubuntu 20.04…

PROJECT=Amlogic ARCH=arm tools/download-tool

PROJECT=Amlogic ARCH=arm make image 
=================================================================================
 End Configuration for CoreELEC
 =================================================================================

config/functions: line 328: [: too many arguments
config/functions: line 281: [: too many arguments
fatal: not a git repository (or any of the parent directories): .git
make: *** [Makefile:9: release] Error 128

I moved your post here, since the other topics are meant for supporting users that are using the official builds, so building CoreELEC yourself is off topic in those threads.

To build CoreELEC 9.2 Amlogic-ng

git clone https://github.com/CoreELEC/CoreELEC.git
cd CoreELEC
git checkout coreelec-9.2
PROJECT=Amlogic-ng ARCH=arm make image

To build CoreELEC 9.2 Amlogic

git clone https://github.com/CoreELEC/CoreELEC.git
cd CoreELEC
git checkout coreelec-9.2
PROJECT=Amlogic ARCH=arm make image

To build CoreELEC 19

git clone https://github.com/CoreELEC/CoreELEC.git
cd CoreELEC
git checkout coreelec-19
PROJECT=Amlogic-ce ARCH=arm make image

Thanks!!! :slight_smile:
This my tvbox
x96s905x 2GB / 16gb
Good build?

git clone https://github.com/CoreELEC/CoreELEC.git
cd CoreELEC
git checkout coreelec-19
PROJECT=Amlogic-ce ARCH=arm make image

We will see when you will actually build it.

FAILURE: scripts/build CoreELEC-settings:target during make_target (default)
*********** FAILED COMMAND ***********
make ${PKG_MAKE_OPTS_TARGET}
**************************************
*********** FAILED COMMAND ***********
${SCRIPTS}/build "${1}" "${PARENT_PKG}"
**************************************
FAILURE: scripts/install CoreELEC-settings:target has failed!

I’m almost sure there was something more on screen at the end with some log file reference where you can see where the issue is.

But I think maybe building CoreELEC is just not for you :thinking:

Error here when compiling 19

e[1;33mBUILDe[0m      linux e[1;37m(target)e[0m
    e[1;35mTOOLCHAINe[0m      make (auto-detect)
make[1]: Entering directory '/home/frank/CoreELEC/build.CoreELEC-Amlogic-ng.arm-19/build/linux-821dcbd92b24d9fa1e3361c957ec481cc0a63aaf'
scripts/kconfig/conf  --oldconfig Kconfig
#
# configuration written to .config
#
make[1]: Leaving directory '/home/frank/CoreELEC/build.CoreELEC-Amlogic-ng.arm-19/build/linux-821dcbd92b24d9fa1e3361c957ec481cc0a63aaf'
make[1]: Entering directory '/home/frank/CoreELEC/build.CoreELEC-Amlogic-ng.arm-19/build/linux-821dcbd92b24d9fa1e3361c957ec481cc0a63aaf'
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  CHK     include/config/kernel.release_full
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  HOSTLD  scripts/dtc/dtc
  CHK     scripts/mod/devicetable-offsets.h
/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): múltiplas definições de "yylloc"; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): definido primeiro aqui
collect2: error: ld returned 1 exit status
make[3]: *** [scripts/Makefile.host:110: scripts/dtc/dtc] Erro 1
make[2]: *** [scripts/Makefile.build:648: scripts/dtc] Erro 2
make[1]: *** [Makefile:564: scripts] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/frank/CoreELEC/build.CoreELEC-Amlogic-ng.arm-19/build/linux-821dcbd92b24d9fa1e3361c957ec481cc0a63aaf'
e[1;31mFAILURE: scripts/build linux:target during make_target (package.mk)e[0m
*********** FAILED COMMAND ***********
kernel_make modules
**************************************
*********** FAILED COMMAND ***********
${SCRIPTS}/build "${1}" "${PARENT_PKG}"
**************************************
e[1;31mFAILURE: scripts/install linux:target has failed!e[0m

sudo apt update && sudo apt upgrade
sudo apt install gcc make git unzip wget xz-utils

cd ~
git clone https://github.com/CoreELEC/CoreELEC.git
cd ~/CoreELEC
git checkout 63f44225b09b8f7c2296754c7598cb0286fa8bc7
PROJECT=Amlogic-ce ARCH=arm DEVICE=Amlogic-ng make image

1 Like

frank@Frank-X99-TF:~/CoreELEC$ git checkout 63f44225b09b8f7c2296754c7598cb0286fa8bc7

Note: switching to '63f44225b09b8f7c2296754c7598cb0286fa8bc7'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 63f44225b0 gobject-introspecion: fix building for host
frank@Frank-X99-TF:~/CoreELEC$

git checkout coreelec-19

1 Like

Hi, I’m currently on the latest corelec-19 branch. Try to compile under Gentoo Linux (gcc 10.3.0) with

PROJECT=Amlogic-ce ARCH=arm DEVICE=Amlogic-ng make image

but still get this error:

^[[1;33mBUILD^[[0m      linux ^[[1;37m(target)^[[0m
^[[1;35mTOOLCHAIN^[[0m      make (auto-detect)
make[1]: Entering directory '/home/dev/CoreELEC/build.CoreELEC-Amlogic-ng.arm-19/build/linux-aca1667086a48951c16a17603c30ea9d7e0704dc'
scripts/kconfig/conf  --oldconfig Kconfig
#
# configuration written to .config
#
make[1]: Leaving directory '/home/dev/CoreELEC/build.CoreELEC-Amlogic-ng.arm-19/build/linux-aca1667086a48951c16a17603c30ea9d7e0704dc'
make[1]: Entering directory '/home/dev/CoreELEC/build.CoreELEC-Amlogic-ng.arm-19/build/linux-aca1667086a48951c16a17603c30ea9d7e0704dc'
scripts/kconfig/conf  --silentoldconfig Kconfig
CHK     include/config/kernel.release
CHK     include/config/kernel.release_full
CHK     include/generated/uapi/linux/version.h
CHK     include/generated/utsrelease.h
HOSTLD  scripts/dtc/dtc
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first >
collect2: Fehler: ld gab 1 als Ende-Status zurück
make[3]: *** [scripts/Makefile.host:110: scripts/dtc/dtc] Fehler 1
make[2]: *** [scripts/Makefile.build:648: scripts/dtc] Fehler 2
make[1]: *** [Makefile:564: scripts] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/dev/CoreELEC/build.CoreELEC-Amlogic-ng.arm-19/build/linux-aca1667086a48951c16a17603c30ea9d7e0704dc'
^[[1;31mFAILURE: scripts/build linux:target during make_target (package.mk)^[[0m
*********** FAILED COMMAND ***********
kernel_make modules
**************************************
*********** FAILED COMMAND ***********
${SCRIPTS}/build "${1}" "${PARENT_PKG}"
**************************************
^[[1;31mFAILURE: scripts/install linux:target has failed!^[[0m

Can you explain what the problem is? Maybe something is wrong build the build tools, wrong version, missing package or what ever…
Thanks!

this it’s a issue about a wrong gcc version. I have installed gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)

You can try to put this patch in folder projects/Amlogic-ce/devices/Amlogic-ng/patches/linux

https://github.com/Tomoms/android_kernel_oppo_msm8974/commit/11647f99b4de6bc460e106e876f72fc7af3e54a6.patch

Thank you!

  1. I switched to gcc 8.5.0 and the build finished successfully.
  2. Also tried the patch and build again with gcc 10.3.0. This also resolved in a successful image.

But for general understanding: If I recognized correctly, some packages are built by the system wide gcc and others are built with a gcc which is downloaded by the build process itself. Is that correct and if so why is there a difference?

Hello.
I wanted to build from the sources Corelec 19.2-Matrix_rc3 for Khadas WIM 3 without pulseaudio (/config/options > PULSEAUDIO_SUPPORT=“no”). I use Ubuntu 18.04 for the build. If I do not disable pulseaudio support in the configuration file, then the project is successfully assembled and running on Khadas WIM 3. But if I disable it, I get an error message in the log:

pm@home:~/CoreELEC$ time PROJECT=Amlogic-ce ARCH=arm DEVICE=Amlogic-ng make image
./scripts/image mkimage

********

Misc. hardware configuration:
 ======================================================
 - ALSA support:			 yes
 - Pulseaudio support:			 no

In file included from ../xbmc/windowing/amlogic/WinSystemAmlogic.cpp:23:
../xbmc/cores/AudioEngine/Sinks/AESinkPULSE.h:20:10: fatal error: pulse/pulseaudio.h: No such file or directory
   20 | #include <pulse/pulseaudio.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
[124/1541] Building CXX object build/cores/audioengine/CMakeFiles/audioengine.dir/AEResampleFactory.cpp.o
[125/1541] Building CXX object build/cores/RetroPlayer/process/amlogic/CMakeFiles/rp-process-amlogic.dir/RPProcessInfoAmlogic.cpp.o
[126/1541] Building CXX object build/windowing/amlogic/CMakeFiles/windowing_Amlogic.dir/WinSystemAmlogicGLESContext.cpp.o
[127/1541] Building CXX object build/cores/CMakeFiles/cores.dir/FFmpeg.cpp.o
[128/1541] Building CXX object build/windowing/amlogic/CMakeFiles/windowing_Amlogic.dir/VideoSyncAML.cpp.o
[129/1541] Building CXX object build/cores/audioengine/CMakeFiles/audioengine.dir/AESinkFactory.cpp.o
[130/1541] Building CXX object build/pvr/filesystem/CMakeFiles/pvr_filesystem.dir/PVRGUIDirectory.cpp.o
ninja: build stopped: subcommand failed.
FAILURE: scripts/build kodi:target during make_target (default)
*********** FAILED COMMAND ***********
ninja ${NINJA_OPTS} ${PKG_MAKE_OPTS_TARGET}
**************************************
*********** FAILED COMMAND ***********
${SCRIPTS}/build "${1}" "${PARENT_PKG}"
**************************************
FAILURE: scripts/install kodi:target has failed!

The following log for this failure is available:
  /home/pm/CoreELEC/build.CoreELEC-Amlogic-ng.arm-19/.threads/logs/296.log

>>> kodi:target seq 296 >>>
[295/329] [FAIL] install kodi:target

The following log for this failure is available:
  /home/pm/CoreELEC/build.CoreELEC-Amlogic-ng.arm-19/.threads/logs/296.log

Parallel build failure - see log for details. Time of failure: Sat Oct 23 15:10:53 +04 2021
Makefile:12: recipe for target 'image' failed
make: *** [image] Error 1

As you can see, the problem occurs when building KODI package.

I tried to build KODI 19.2.0 separately in my home directory from sources according to the following instructions from GitHub.

cmake ../kodi -DCMAKE_INSTALL_PREFIX=/usr/local -DCORE_PLATFORM_NAME=x11 -DAPP_RENDER_SYSTEM=gl -DENABLE_PULSEAUDIO=OFF -DENABLE_ALSA=ON

Kodi builds without any errors and runs normally.

Just in case, I checked the keys (-DENABLE_PULSEAUDIO=OFF -DENABLE_ALSA=ON) in the Corelec configuration files - everything is correct.

Can you tell me what could be the reason for errors when building the project? Is pulseaudio really needed for ARM architecture, unlike X86-64?

I think kodi aml code just doesn’t care if to be build without pulseaudio. If you really need to disable pa you will have to add few ifdefs in the kodi code yourself.

Thank you for the answer.
Yes, I really want to disable pulseaudio, as I previously did in OpenELEC for my x86-64 PC. Now Khadas VIM 3 is planned to replace this PC.

You suggest adding a couple of ifdefs in the code, but I don’t think it will work out with just a couple of edits. I assume that much more changes will have to be made. If you can tell me exactly where to make changes, then I will be very grateful!

I still think that the solution should be simpler, since KODI version 19.2.0 is perfectly assembled without pulseaudio for the x86-64 platform, and KODI version 19.1.0 from CoreELEC is not assembled for the AML platform. I will try to build CoreELEC for the test without pulseaudio for the x86-64 platform. If everything works out, it will confirm that the problem is in the KODI version for the AMD platform.

Just look into file xbmc/windowing/amlogic/WinSystemAmlogic.cpp for pulse string. There are only 2 hits.

Your recommendations helped. Now the project is being built without errors. This is what the patch code looks like:

diff -Naur kodi-e1d5be86494746261b701a8c9dae796cfcbcd42e.orig/xbmc/windowing/amlogic/WinSystemAmlogic.cpp kodi-e1d5be86494746261b701a8c9dae796cfcbcd42e/xbmc/windowing/amlogic/WinSystemAmlogic.cpp
--- kodi-e1d5be86494746261b701a8c9dae796cfcbcd42e.orig/xbmc/windowing/amlogic/WinSystemAmlogic.cpp	2021-10-25 10:45:13.749310562 +0400
+++ kodi-e1d5be86494746261b701a8c9dae796cfcbcd42e/xbmc/windowing/amlogic/WinSystemAmlogic.cpp	2021-10-25 10:50:36.009238084 +0400
@@ -20,7 +20,11 @@
 // AESink Factory
 #include "cores/AudioEngine/AESinkFactory.h"
 #include "cores/AudioEngine/Sinks/AESinkALSA.h"
+
+#ifdef HAS_PULSEAUDIO
 #include "cores/AudioEngine/Sinks/AESinkPULSE.h"
+#endif
+
 #include "windowing/GraphicContext.h"
 #include "windowing/Resolution.h"
 #include "platform/linux/powermanagement/LinuxPowerSyscall.h"
@@ -69,7 +73,11 @@
   // Register sink
   AE::CAESinkFactory::ClearSinks();
   CAESinkALSA::Register();
+
+#ifdef HAS_PULSEAUDIO
   CAESinkPULSE::Register();
+#endif
+
   m_libinput->Start();
 }
 

But pulseaudio for bluetooth output still appears in the list of devices in the KODI settings. When playing audio files in 16/44.1 and 24/192, the 48 kHz frequency is displayed on the DAC screen all the time, as if pulseaudio is still working.

About | FAQ | Terms of Service | Privacy Policy | Legal Notice