gcc

cross-compile for ARM64, understanding make TARGET=aarch64

眉间皱痕 提交于 2021-02-11 15:59:05
问题 I'm trying to cross-compile a library for ARM64, I'm using Ubuntu 18.04 x86_64 host system for a build and the way I'm doing the cross-compile as sudo apt-get update sudo apt-get install crossbuild-essential-arm64 and do the make make -j 4 TARGET=aarch64 wonder what a compiler is invoked? Is it possible to set the latest gcc from ARM? FYI. I'm trying to follow TensorFlow cross-compile for ARM64 and set the latest GNU Toolchain for ARM64. 来源: https://stackoverflow.com/questions/62139412/cross

No arm-linux-androideabi-gcc in prebuilts for ndk r21d

二次信任 提交于 2021-02-11 15:02:04
问题 Hi I'm trying to build a custom android kernel. I was told to $ export CROSS_COMPILE=/home/user/adb-fastboot/kernel-custom/android-ndk-r21d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi- with nothing after the dash But when I $ make clean && make mrproper I get make: /home/user/adb-fastboot/kernel-custom/android-ndk-r21d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc: Command not found So when I assume that make

Selected processor does not support `dmb ish' in ARM mode

让人想犯罪 __ 提交于 2021-02-11 14:34:22
问题 I am building an embedded linux distro on a Beaglebone Black (AM335x chip Cortex-A8 Arm-v7 Instruction set) using crosstool-NG, U-Boot, Kernel (5.5.5) and buildroot. When compiling the kernel I am getting this error message: /tmp/ccxFZlyN.s: Assembler messages: /tmp/ccxFZlyN.s:39: Error: selected processor does not support `isb ' in ARM mode /tmp/ccxFZlyN.s:90: Error: selected processor does not support `isb ' in ARM mode /tmp/ccxFZlyN.s:371: Error: selected processor does not support `isb '

linkage error:multiple definitions of global variables

为君一笑 提交于 2021-02-11 14:24:42
问题 I am using gcc for compiling a number of .c files. Lets say following is the case: C files are: main.c tree.c header file is: tree.h I have declared some golbal variables in tree.h . Lets say following is the global varible with value assigned: int fanout = 5; Earlier I had kept main() function in tree.c file. And there was no problem in linking. But now i want to keep the main function separate . I just moved the main function in the newly created .c file. Now the problem is, it shows the

自制操作系统Antz(6)——内核初步,引入c语言

早过忘川 提交于 2021-02-11 13:22:07
Antz系统更新地址: https://www.cnblogs.com/LexMoon/category/1262287.html Linux内核源码分析地址: https://www.cnblogs.com/LexMoon/category/1267413.html    在前几天的任务中,我们已经简单实现了MBR,直接操作显示器和硬盘操作来加载其他扇区的程序,如今已经可以进入保护模式了,之前一直使用的是汇编语言,接下来要使用c语言实现内核了。 0. GCC前提   gcc -c -o main.o main.c   -c的作用是编译,汇编到目标代码,不进行链接,也就是直接生成目标文件。   -o的作用是将输出的文件以指定文件名来存储,有同名文件会直接覆盖。   如果你不会使用GCC,请先去略作了解。   这行命令会生成一个main.o文件。它只是一个目标文件,也是待重定位文件,重定位是指文件里面所用的符号还没有安排地址,这些符号的地址要与其他目标文件组成一个可执行文件时再重新定位(排地址),符号是指该目标文件中所调用的函数或使用的变量,这里的组成就是指链接。   main.o是可重定位文件,ld命令可以链接,指定最终生成文件的起始虚拟地址。   ld main.o -Ttext 0xc0001500 -e main -o main.bin   

GCC: How to customising warning and errors generated from compilation

时光怂恿深爱的人放手 提交于 2021-02-11 12:51:38
问题 My Usecase: I have two c language files: ApplicationCode.c and UserCode.c . Application code is something generated by my app and UserCode is available to my application user where he can write his own code. ApplicationCode.c internally uses UserCode.c and calls out its methods/function. One thing you can assume here that ApplicationCode.c will never have any errors but could have warnings generated by gcc compiler. And UserCode.c can have both errors and warnings. So, While compiling code I

Problem to compile a C-program by GCC with GD2 library installed via MacPorts

两盒软妹~` 提交于 2021-02-11 12:50:37
问题 I have successfully compiled a C-program by GCC on Mac with GD2 library installed directly from sources. Now I am trying to do that with GD2 library installed via MacPorts and have the following error message: plotgeometry.c:5:16: error: gd.h: No such file or directory plotgeometry.c: In function 'PlotGeometry': plotgeometry.c:28: error: 'gdImagePtr' undeclared (first use in this function) plotgeometry.c:28: error: (Each undeclared identifier is reported only once plotgeometry.c:28: error:

Problem to compile a C-program by GCC with GD2 library installed via MacPorts

Deadly 提交于 2021-02-11 12:50:08
问题 I have successfully compiled a C-program by GCC on Mac with GD2 library installed directly from sources. Now I am trying to do that with GD2 library installed via MacPorts and have the following error message: plotgeometry.c:5:16: error: gd.h: No such file or directory plotgeometry.c: In function 'PlotGeometry': plotgeometry.c:28: error: 'gdImagePtr' undeclared (first use in this function) plotgeometry.c:28: error: (Each undeclared identifier is reported only once plotgeometry.c:28: error:

Does asmlinkage mean stack or register?

别说谁变了你拦得住时间么 提交于 2021-02-11 12:32:00
问题 In most languages, C included the stack is used for function calls. That's why you get a "Stack Overflow" error if you are not careful in recursion. (Pun not intended). If that is true then what is so special about the asmlinkage GCC directive. It says, from #kernelnewbies The asmlinkage tag is one other thing that we should observe about this simple function. This is a #define for some gcc magic that tells the compiler that the function should not expect to find any of its arguments in

sbrk(0) value getting increased after calling printf

六月ゝ 毕业季﹏ 提交于 2021-02-11 07:43:47
问题 I am trying to write my own malloc implementation, following an online course. Issue I am facing is that i always get segmentation fault, and when i tried to debug it always point to printf statement, which is just a string. After further investigation i found the value for sbrk(0) always increase after printf gets called. I am not sure but i think my malloc implementation overwrites some memory space that printf might be using. But is it possible for printf to be there. The program works