I'm trying to install the toolchain for ARM cross-compilation. I already installed GCC 4.8.
The installation of arm-none-linux-gnueabi-gcc fails with the following output:
$ sudo port install arm-none-linux-gnueabi-*
---> Cleaning arm-none-linux-gnueabi-binutils
---> Computing dependencies for arm-none-linux-gnueabi-gcc
---> Fetching archive for arm-none-linux-gnueabi-gcc
---> Attempting to fetch arm-none-linux-gnueabi-gcc-2005q3-2_0.darwin_12.x86_64.tbz2 from http://lil.fr.packages.macports.org/arm-none-linux-gnueabi-gcc
---> Attempting to fetch arm-none-linux-gnueabi-gcc-2005q3-2_0.darwin_12.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/arm-none-linux-gnueabi-gcc
---> Attempting to fetch arm-none-linux-gnueabi-gcc-2005q3-2_0.darwin_12.x86_64.tbz2 from http://packages.macports.org/arm-none-linux-gnueabi-gcc
---> Fetching distfiles for arm-none-linux-gnueabi-gcc
---> Verifying checksums for arm-none-linux-gnueabi-gcc
---> Extracting arm-none-linux-gnueabi-gcc
---> Applying patches to arm-none-linux-gnueabi-gcc
---> Configuring arm-none-linux-gnueabi-gcc
---> Building arm-none-linux-gnueabi-gcc
Error: org.macports.build for port arm-none-linux-gnueabi-gcc returned: command execution failed
Please see the log file for port arm-none-linux-gnueabi-gcc for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_cross_arm-none-linux-gnueabi-gcc/arm-none-linux-gnueabi-gcc/main.log
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port arm-none-linux-gnueabi-gcc failed
The content of the log file:
version:1
...
:info:build make[1]: *** [cp/decl.o] Error 1
:info:build make[1]: *** Waiting for unfinished jobs....
...
:info:build 10 warnings generated.
:info:build 7 warnings generated.
:info:build 5 warnings generated.
:info:build 60 warnings generated.
:info:build 6 warnings generated.
:info:build 125 warnings generated.
:info:build 20 warnings generated.
:info:build rm arm-none-linux-gnueabi-cpp.pod fsf-funding.pod gcov.pod arm-none-linux-gnueabi-gcc.pod gfdl.pod gpl.pod
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_cross_arm-none-linux-gnueabi-gcc/arm-none-linux-gnueabi-gcc/work/build/gcc'
:info:build make: *** [all-gcc] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_cross_arm-none-linux-gnueabi-gcc/arm-none-linux-gnueabi-gcc/work/build'
:info:build Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_cross_arm-none-linux-gnueabi-gcc/arm-none-linux-gnueabi-gcc/work/build" && /usr/bin/make -j8 -w all AR_FOR_TARGET=arm-none-linux-gnueabi-ar AS_FOR_TARGET=arm-none-linux-gnueabi-as LD_FOR_TARGET=arm-none-linux-gnueabi-ld NM_FOR_TARGET=arm-none-linux-gnueabi-nm RANLIB_FOR_TARGET=arm-none-linux-gnueabi-ranlib
:info:build Exit code: 2
:error:build org.macports.build for port arm-none-linux-gnueabi-gcc returned: command execution failed
:debug:build Error code: CHILDSTATUS 20512 2
:debug:build Backtrace: command execution failed
while executing
"system -nice 0 $fullcmdstring"
("eval" body line 1)
invoked from within
"eval system $notty $nice \$fullcmdstring"
invoked from within
"command_exec build"
(procedure "portbuild::build_main" line 8)
invoked from within
"$procedure $targetname"
:info:build Warning: targets not executed for arm-none-linux-gnueabi-gcc: org.macports.activate org.macports.build org.macports.destroot org.macports.install
:notice:build Please see the log file for port arm-none-linux-gnueabi-gcc for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_cross_arm-none-linux-gnueabi-gcc/arm-none-linux-gnueabi-gcc/main.log
Thank you for sharing your ideas.
Build it with FSF gcc.
e.g.
port install arm-none-linux-gnueabi-gcc configure.compiler=macports-gcc-4.8
P.S. make sure u have gcc-4.8 installed.
This issue is caused by the command:
cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_cross_arm-none-linux-gnueabi-gcc/arm-none-linux-gnueabi-gcc/work/build" && /usr/bin/make -j8 -w all AR_FOR_TARGET=arm-none-linux-gnueabi-ar AS_FOR_TARGET=arm-none-linux-gnueabi-as LD_FOR_TARGET=arm-none-linux-gnueabi-ld NM_FOR_TARGET=arm-none-linux-gnueabi-nm RANLIB_FOR_TARGET=arm-none-linux-gnueabi-ranlib
issueing this command the output from clang:
...
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_cross_arm-none-linux-gnueabi-gcc/arm-none-linux-gnueabi-gcc/work/gcc-2005q3/gcc/cp/decl.c:11405:
./gtype-cp.h:410:7: warning: switch condition has boolean value
switch (((*x).u).h.is_lang_type_class)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./gtype-cp.h:412:14: warning: overflow converting case value to switch condition type (2 to 0) [-Wswitch]
case 2:
^
./gtype-cp.h:431:14: error: duplicate case value '0'
case 0:
^
./gtype-cp.h:412:14: note: previous case defined here
case 2:
^
./gtype-cp.h:857:7: warning: switch condition has boolean value
switch (((*x).u).h.is_lang_type_class)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./gtype-cp.h:859:14: warning: overflow converting case value to switch condition type (2 to 0) [-Wswitch]
case 2:
^
./gtype-cp.h:879:14: error: duplicate case value '0'
case 0:
^
./gtype-cp.h:859:14: note: previous case defined here
case 2:
^
./gtype-cp.h:1475:3: warning: switch condition has boolean value
switch (((*x).u).h.is_lang_type_class)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./gtype-cp.h:1477:10: warning: overflow converting case value to switch condition type (2 to 0) [-Wswitch]
case 2:
^
./gtype-cp.h:1511:10: error: duplicate case value '0'
case 0:
^
./gtype-cp.h:1477:10: note: previous case defined here
case 2:
Related
I'm trying to compile this project from github but I am running into the following error:
make -C /lib/modules/5.15.0-53-generic/build M=/home/jr/Documents/ProtoVirt modules EXTRA_CFLAGS="-g -DDEBUG"
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-53-generic'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
You are using: gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
CC [M] /home/jr/Documents/ProtoVirt/protovirt.o
In file included from /home/jr/Documents/ProtoVirt/protovirt.c:23:
/home/jr/Documents/ProtoVirt/protovirt.h: In function ‘__rdmsr1’:
/home/jr/Documents/ProtoVirt/protovirt.h:25:22: error: expected ‘:’ or ‘)’ before ‘_ASM_EXTABLE_HANDLE’
25 | _ASM_EXTABLE_HANDLE(1b, 2b, ex_handler_rdmsr_unsafe)
| ^~~~~~~~~~~~~~~~~~~
/home/jr/Documents/ProtoVirt/protovirt.h:25:42: error: invalid suffix "b" on integer constant
25 | _ASM_EXTABLE_HANDLE(1b, 2b, ex_handler_rdmsr_unsafe)
| ^~
/home/jr/Documents/ProtoVirt/protovirt.h:25:46: error: invalid suffix "b" on integer constant
25 | _ASM_EXTABLE_HANDLE(1b, 2b, ex_handler_rdmsr_unsafe)
| ^~
/home/jr/Documents/ProtoVirt/protovirt.c: In function ‘initVmcsControlField’:
/home/jr/Documents/ProtoVirt/protovirt.c:282:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
282 | void *costum_rip;
| ^~~~
make[2]: *** [scripts/Makefile.build:297: /home/jr/Documents/ProtoVirt/protovirt.o] Error 1
make[1]: *** [Makefile:1903: /home/jr/Documents/ProtoVirt] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-53-generic'
make: *** [Makefile:12: modules] Error 2
The command I'm running is make. Can anyone explain to me what I'm doing wrong?
The _ASM_EXTABLE_HANDLE macro is replaced by _ASM_EXTABLE_TYPE in the newest kernel versions.
I'm upgrading from Redis 6.0.13 to 6.2.5 on AIX.
On 6.2.5, the build fails with this error:
MAKE hdr_histogram
cd hdr_histogram && make
make[3]: Entering directory '/home/jenkins/redis/deps/hdr_histogram'
/opt/atc-2.0/opt/gcc/bin/gcc -Wall -Os -g -DLUA_USE_POSIX -DLUA_USE_DLOPEN -include stdint-gcc.h -c hdr_histogram.c
make[3]: Leaving directory '/home/jenkins/redis/deps/hdr_histogram'
make[2]: Leaving directory '/home/jenkins/redis/deps'
CC adlist.o
CC quicklist.o
CC ae.o
In file included from ae.c:60:
ae_select.c: In function 'aeApiResize':
ae_select.c:52:37: warning: unused parameter 'eventLoop' [-Wunused-parameter]
52 | static int aeApiResize(aeEventLoop *eventLoop, int setsize) {
| ~~~~~~~~~~~~~^~~~~~~~~
In file included from /usr/include/poll.h:30,
from ae.c:41:
ae_select.c: In function 'aeApiPoll':
ae_select.c:89:43: error: 'aeEventLoop' has no member named 'reqevents'; did you mean 'events'?
89 | aeFileEvent *fe = &eventLoop->events[j];
| ^~~~~~
ae.c: In function 'aeCreateEventLoop':
ae.c:73:16: error: 'aeEventLoop' has no member named 'reqevents'; did you mean 'events'?
73 | eventLoop->events = zmalloc(sizeof(aeFileEvent)*setsize);
| ^~~~~~
...
I checked the eventLoop struct, and it does indeed contain events, but I see the build failing because it's trying to access reqevents. I can't find reqevents anywhere in the project (with grep -R 'reqevents' .)
This error only happens on AIX 7.1 - Linux and macOS both work fine.
Do you know why req would be prepended to the struct members on AIX, and how I might solve the error?
#include <stdio.h>
int main() {
printf("Hello, world!\n");
return 0;
}
When I want to compile this sample code with gcc aa.c -o tt I get an error:
/usr/bin/ld: 1: Syntax error: ")" unexpected
collect2: error: ld returned 2 exit status
I got this error when making a repo to install and I got the below error in the log file (a portion of the file).
gcc version 7.5.0 (Ubuntu 7.5.0-6ubuntu2)
configure:3674: $? = 0
configure:3663: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3674: $? = 1
configure:3663: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:3674: $? = 1
configure:3694: checking whether the C compiler works
configure:3716: gcc conftest.c >&5
/usr/bin/ld: 1: Syntax error: ")" unexpected
collect2: error: ld returned 2 exit status
configure:3720: $? = 1
This question already has answers here:
undefined reference to `shm_open' using CMake
(2 answers)
Closed 1 year ago.
Simple Program:
#include <stdlib.h>
#include <sys/mman.h>
#include <fcntl.h>
int main() {
int shm_fd;
shm_fd=shm_open("sh",O_CREAT|O_RDWR,0666);
return 0;
}
The error is:
Warnung: undefined reference to »shm_open«
collect2: error: ld returned 1 exit status
CMakeFiles/Share_Memory_Project.dir/build.make:102: recipe for target 'Share_Memory_Project' failed
make[3]: *** [Share_Memory_Project] Error 1
CMakeFiles/Makefile2:94: recipe for target 'CMakeFiles/Share_Memory_Project.dir/all' failed
make[2]: *** [CMakeFiles/Share_Memory_Project.dir/all] Error 2
CMakeFiles/Makefile2:101: recipe for target 'CMakeFiles/Share_Memory_Project.dir/rule' failed
make[1]: *** [CMakeFiles/Share_Memory_Project.dir/rule] Error 2
Makefile:137: recipe for target 'Share_Memory_Project' failed
make: *** [Share_Memory_Project] Error 2
To fix this Problem, I have to add a Compiler Flag:
-lrt at the end. Like this: gcc main.c -o main -lrt. So When I put this in Command Line at Ubuntu Terminal it compile fine.
My Question is: How to add this Flag at my CMakeLists.txt in Clion?
How my file currently looks:
cmake_minimum_required(VERSION 3.19)
project(Share_Memory_Project C)
set(CMAKE_C_STANDARD 99)
add_executable(Share_Memory_Project main.c)
To link a target with a library, use target_link_libraries. You would:
add_executable(Share_Memory_Project main.c)
target_link_libraries(Share_Memory_Project PUBLIC rt)
If I manually compile the code below, I got no error:
/*
* File: newmain.c
* Author: Mike
*
* Created on September 18, 2015, 7:36 PM
*/
#include <stdio.h>
#include <stdlib.h>
/*
*
*/
int main(int argc, char** argv) {
printf ("Hello!");
return 0;
}
However, by doing the with NetBeans, I got the following error:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/cygdrive/c/Users/Mike/Documents/NetBeansProjects/CppApplication_1'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_4.x-Windows/cppapplication_1.exe
make[2]: Entering directory '/cygdrive/c/Users/Mike/Documents/NetBeansProjects/CppApplication_1'
mkdir -p build/Debug/Cygwin_4.x-Windows
rm -f "build/Debug/Cygwin_4.x-Windows/newmain.o.d"
gcc -c -g -MMD -MP -MF "build/Debug/Cygwin_4.x-Windows/newmain.o.d" -o build/Debug/Cygwin_4.x-Windows/newmain.o newmain.c
mkdir -p dist/Debug/Cygwin_4.x-Windows
g++ -o dist/Debug/Cygwin_4.x-Windows/cppapplication_1 build/Debug/Cygwin_4.x-Windows/main.o build/Debug/Cygwin_4.x-Windows/newmain.o
build/Debug/Cygwin_4.x-Windows/newmain.o: In function `main':
/cygdrive/c/Users/Mike/Documents/NetBeansProjects/CppApplication_1/newmain.c:14: multiple definition of `main'
build/Debug/Cygwin_4.x-Windows/main.o:/cygdrive/c/Users/Mike/Documents/NetBeansProjects/CppApplication_1/main.cpp:15: first defined here
collect2: error: ld returned 1 exit status
nbproject/Makefile-Debug.mk:63: recipe for target 'dist/Debug/Cygwin_4.x-Windows/cppapplication_1.exe' failed
make[2]: *** [dist/Debug/Cygwin_4.x-Windows/cppapplication_1.exe] Error 1
make[2]: Leaving directory '/cygdrive/c/Users/Mike/Documents/NetBeansProjects/CppApplication_1'
nbproject/Makefile-Debug.mk:60: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/Mike/Documents/NetBeansProjects/CppApplication_1'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
How can I get this code being executed in the NetBeans too?