Profile gcc-built app with Xcode Instruments
I want to analyse a console program which is compiled with gcc.Here is my makefileall: buildbuild: program xcrun dsymutil program -o program.dSYMprogram: Class.o main.o g++ -std=c++2a $^ -o $@%.o:...
View ArticleClang does not accept -shared -fPIC -pie compiler flags simultaneously
Given by below code:#include <stdio.h>void output(){ printf("hello \n");}int main(){ output(); return 0;}When the above code is compiled by below command:gcc hello.c -shared -fPIC -pie -o...
View ArticleHow to change the option of GCC compiler?
I observe with the following command :$ gcc -vThat my compiler has by default the generation of PIE (position independant executable).I want to disable this option, because my OS misidentify ELF file...
View ArticleLinker script to add tables to rodata segment
I'm trying to port some code that builds up tables at compile time. I don't want to maintain a stand alone linking script for this. I just want to add a few things to all the magic that the compiler is...
View ArticleWhen creating a new tool collection in Netbeans, why is it not autofilling...
IntroductionI'm helping a developer colleague to set up a cross compiler toolchain in Netbeans 8.2 for the Nano-PI board.We both installed the toolchain following the instructions in this link.Since we...
View ArticleWhy does gcc's implementation of openMP fail to parallelise a recursive...
I am trying to parallelise these recursive functions with openMP tasks, when I compile with gcc it runs only on 1 thread. When i compile it with clang it runs on multiple threadsThe second function...
View ArticleGenerating code at compile-time using scripts
I would ideally like to be able to add (very repetitive) C/C++ code to my actual code, but at compile time, code which would come from say, the stdout of a python script, the same way one does with...
View ArticleHow to fix compilation error while assigning one type of structure pointer to...
I am getting compilation error for below sample code in MacOS however its work fine in following website: https://www.onlinegdb.com.Following gcc compiler version I have in MacOS:gcc...
View ArticleUnable to access variable name corresponding to register RTX in gcc
Is it possible to access the variable name if we have an RTX which is a reg that corresponds to a variable declared by the user in GCC?I have found the macro REG_USERVAR_P (RTX) in rtl.h which returns...
View ArticleNo exe file being generated in C using recent Cygwin versions
GCC 4.9.2 does not create an executable, neither a.out or -o hello.exe. Adding -v to the compile line indicates that -o is switched to a non-existent temporary file, for example: -o...
View ArticleWhat exactly is -fno-builtin doing here?
So I was reading Hacking the Art of Exploitation and in the book, they use the strcpy() function in their C code:1 #include <stdio.h>2 #include <string.h>3 4 int main() {5 char str_a[20];6...
View ArticleOrdering of object files and libraries in static linking
I've created a simple static library libvec.a with AR tool from simple addv.o and multo.o. The object file addv.o contains 1 function symbol (addvec) and multo.o contains 1 function (multvec). I have...
View ArticleHow to zip a gcc compiler?
I would like to use gcc compiler in my aws lambda function. In my application user can upload their code (c, c++) and I have to evaluate it in my lambda function. I am just wondering is there any way...
View ArticleAssembly executable doesn't show anything (x64)
Very simple assembly introduction code.Seems to compile ok through gcc -o prog1 prog1.s, then ./prog1 just skips a line and shows nothing, like waiting an input the code doesn't ask. What's wrong?Using...
View ArticleUnable to find pthread Eclipse GCC linker issue
I have tried all the other postings on this issue and can confirm I have set up in properties->c/c++ build->Settings->Cross G++ Linker the following:-pthread in the linker flags in the Eclipse...
View ArticleHow to build ltrace for arm v4 little endian
I didn't understand how can I build ltrace statically for arm v4 little endian.I have gcc cross compiler for that.
View Articleinstall cuda for pytorch cudatoolkit=10.2 on fedora32 with nvidia optimus system
I have recently switched to fed32 on my ThinkPad E470 with optimus system (see [1])and I am trying to get pytorch cudatoolkit10.2 to work.However, I am struggling with the instruction given in [2] both...
View ArticleWill gcc10 upgrade golang library
I try compile golang program to sparc-sun-solaris2.11 with gcc but encountered problem /tmp/go-build442023874/b001/_gomod_.go:3:3: error: __debug_modinfo__ is not a function; //go:linkname is only...
View ArticleCompilation error with simple helloworld.c program with gcc
When I tried to compile my helloworld.c with gcc helloworld.c -v -o myhelloworldI have the following error : Using built-in...
View ArticleGetting the compiler default include path into a makefile
I am can run a shell command to grab the default include path from the compiler (and append the -I):arm-none-eabi-gcc -xc -E -Wp,-v /dev/null 2>&1 | sed -En '/#include <...> search starts...
View Article