Entware / Entware-ng

Entware-ng
GNU General Public License v2.0
1.21k stars 153 forks source link

Package request: Clang #757

Closed Nick-Msk closed 7 years ago

Nick-Msk commented 7 years ago

Package: clang

Improved c/c++ compiler. Better than gcc. Primary on macos.

Platform: Arm 7 (Synology DS116)

I tried to build it witl cmake, but without success.

Error when building libLTO:

/opt/bin/ld: failed to set dynamic section sizes: Memory exhausted collect2: error: ld returned 1 exit status make[2]: [tools/lto/CMakeFiles/LTO.dir/build.make:268: lib/libLTO.so.6.0.0svn] Error 1 make[1]: [CMakeFiles/Makefile2:14196: tools/lto/CMakeFiles/LTO.dir/all] Error 2 make: *** [Makefile:152: all] Error 2

Device has 1GB real memory. I increased swap +=6GB but get the same error.

user@nserv:/volume1/homes/user/code/source/clang/builddir$ swapon NAME TYPE SIZE USED PRIO /dev/sda2 partition 2G 291.1M -1 /volume1/swap.swp file 4G 140K -2

Nick-Msk commented 7 years ago

upd: build is done using -D CMAKE_BUILD_TYPE="Release"

but make install _CMake Error at tools/llvm-split/cmake_install.cmake:41 (file): file INSTALL cannot copy file "/volume1/homes/skelet/code/source/clang/builddir/bin/llvm-split" to "/usr/local/bin/llvm-split". Call Stack (most recent call first): tools/cmake_install.cmake:87 (include) cmakeinstall.cmake:66 (include)

Nick-Msk commented 7 years ago

upd:

now it's installed, but really not working

_skelet@nserv:/code/tests$ cat hello.c

include

int main(void){ printf("Hello, World!\n"); } skelet@nserv:/code/tests$ clang --version clang version 6.0.0 (https://github.com/llvm-mirror/clang.git 9b13d907c509a53fd938dcc777bb7dd097cea4c0) (https://github.com/llvm-mirror/llvm.git 707fb1cf0ca99d98c59f1ae87b7e0ff9b2dd0c8b) Target: armv7l-unknown-linux-gnueabi Thread model: posix InstalledDir: /usr/local/bin skelet@nserv:/code/tests$ which clang /usr/local/bin/clang skelet@nserv:~/code/tests$ clang hello.c -o hello hello.c:1:10: fatal error: 'stdio.h' file not found

include

     ^~~~~~~~~

1 error generated._

Even if set CFLAGS - it's useless:

_skelet@nserv:/code/tests$ echo $CFLAGS

skelet@nserv:/code/tests$ export CFLAGS=-I/opt/include skelet@nserv:/code/tests$ clang hello.c -o hello hello.c:1:10: fatal error: 'stdio.h' file not found

include

     ^~~~~~~~~

1 error generated._

TCB13 commented 7 years ago

+1 here!

zyxmon commented 7 years ago

Please ask upstream for clang. We will port it to entware.

Nick-Msk commented 6 years ago

opkg update Downloading http://pkg.entware.net/binaries/armv7/Packages.gz Updated list of available packages in /opt/var/opkg-lists/packages :~$ opkg list | grep -i clang