RISC-V G++ and Gfortran
I would like to build RISC-V g++ and gfortran compiler by downloading all source codes to host PC (for Linux OS) and then rebuild compiler from scratch. I can build RISC-V gcc compiler from scratch by...
View ArticleHow to disable relro to overwrite fini_array or got.plt element
I am reading the book Hacking: The art of exploitation and there is a format string exploit example which attempts to overwrite an address of the dtors with the address of a shellcode environment...
View Articleproblems with header file in android studio
I have a problem to compile an old freedb lib to android. I always get the error:FreeDB/DBStructures.h:36: error: undefined reference to 'DatabaseEntryHead::operator=(DatabaseEntryHead const&)'The...
View ArticleGNU gcc/ld - wrapping a call to symbol with caller and callee defined in the...
to clarify, my question refers to wrapping/intercepting calls from one function/symbol to another function/symbol when the caller and the callee are defined in the same compilation unit with the GCC...
View Articlegcc generates .h.gch files even though there's no .h files in compiler
We're making a makefile for a class project, and we're having problems with gcc generating .h.gch files. Looked around on stack overflow and apparently it's normally caused by either including .h files...
View Articlenvcc error compiling ld error undefined reference to symbol 'XConvertSelection'
I am trying to compile nvcc that works on other machines and clusters, now that im running x86-64 machine I was getting errors for relocation R_X86_64_32 against ... diffrent lib files and errors....
View ArticleAssembly issue with '[' [closed]
to make it short: when I am trying to assemble my code I get thisError: invalid char '[' beginning operand 2 '[esp+4]' andError: invalid char '[' beginning operand 1 '[edx]'The most relevant code is...
View Articleinline label to assembly [closed]
I want to inline a label into assembly.https://gcc.godbolt.org/z/rL3YRN But the assembly output is not my expected. I want the label inserted before "size = &a - &b", just like the c source. I...
View ArticleHow to use static assert in C to check the types of parameters passed to a macro
I need to write a C macro that checks to ensure all parameters passed to it are unsigned and of the same integer type. Ex: all input params are uint8_t, or all uint16_t, or all uint32_t, or all...
View ArticleWhere does an “ADD” instruction store the result? [duplicate]
According to the description of https://c9x.me/x86/html/file_module_x86_id_5.html:Adds the first operand (destination operand) and the second operand (source operand) and stores the result in the...
View ArticleWhy is the first argument of getline a pointer to pointer "char**" instead of...
I use getline function to read a line from STDIN.The prototype of getline is: ssize_t getline(char **lineptr, size_t *n, FILE *stream); I use this as a test program which get from...
View ArticleHow to link the cs50 C library in gcc on windows
I'm new to С programming and have been trying to compile my code using MinGW/GCC, but I try to include cs50 (cs50.c, cs50.h) library, and the compiler can't find it. Help me compile who knows what's...
View Articlegcc/clang usage of restrict keyword for local variables and struct fields
Can't figure out how to convince gcc/clang that my pointers don't intersect; for what I see, it looks like restrict is only honored if specified in function arguments and ignored otherwise. Here is my...
View ArticleGCC arm instruction mode when compiling in thumb mode
I'm wondering how GCC configured using --with-mode=thumb handles compiling/assembling code that makes use of ARM mode sections if the -marm flag is not specified. That is:GCC is compiled with...
View ArticleCant link boost library with g++ Windows
I'm trying to build the following code:Content of "Source.cpp"#include <boost/filesystem.hpp> using namespace boost::filesystem; int main(int argc, char* argv[]) { path myPath("foo"); if...
View ArticleHow do I solve the gcc error on finding pkg-config?
This question seems to have been asked a zillion times, but unfortunately, none of the answers helped me.I believe I have installed gtk correctly. My pkg-config environment seems okay. I'm not so sure...
View ArticleCheck wheter atomic ptr is not initialized in gcc 4.4.7 (without nullptr)
During re-factorization of singleton class to be thread safe (fallowing Herb Sutter advice how to write proper double-check locking) I came across problem with my version of compiler (gcc 4.4.7 with...
View ArticleCopy the adress of array B to an index in array A
Quick one... i want to copy the adress of an array 'B' to an index in array 'A', something like "strcat":char *strcatme (char s1[] ,char s2[]){ int i=0; while (s1[i]!='\0') i++; s1[i] = &s2; return...
View Articlehow do I eliminate linker error mingw32/bin/ld.exe: cannot find -lSDL
I am trying to build SDL for use with Eclipse. I am trying to remove this linker error:Beginning Compilation21:15:53 **** Incremental Build of configuration Debug for project CMD **** Info: Internal...
View Articlehow to resolve libgomp.spec missing while attempting to install rmagick gem...
Error while attempting to install rmagick on an Amazon Linux Version 2018.03After yum install ImageMagickattempting gem install rmagick causes the following error. This happens with any rmagic gem...
View Article