Tagged: gcc

About c : Declare-pointered-struct-at-build-time

Question Detail This is how I can initialize a struct with pointers at build time. struct example_struct { int count; int *values; }; int i1[] = { 1, 2 }; int i2[] = {...

About c++ : c-new-and-this-return-different-addresses

Question Detail I have some code similar to this: #include <iostream> class Grandparent { public: virtual void foo() {}; }; class Parent : public Grandparent { public: virtual void bar() {}; }; class Child...

About linux : LFS-Fails-on-step-618-with-x8664-lfs-linux-gnu-gcc–dumpspecs-tmp-specs

Question Detail I’m on 6.18 of LFS. https://linuxfromscratch.org/lfs/view/stable-systemd/chapter06/gcc-pass2.html But I keep getting the error below. g++ -fno-PIE -c -g -O2 -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros...

About linux : -Wimplicit-function-declaration-while-make-module-qmiwwan

Question Detail my Makefile: obj-m += qmi_wwan.o CFLAGS += -Werror -Wno-implicit-function-declaration all: make -C /lib/modules/5.10.103-v7l+/build M=$(PWD) modules clean: make -C /lib/modules/5.10.103-v7l+/build M=$(PWD) clean Error i get while compiling: warning: implicit declaration of function ‘dev_sw_netstats_tx_add’;...

About c++ : Problem-in-Cross-compilation-of-project-having-standard-C-libraries

Question Detail We have developed a project using WSL compiler for x86 platform which is compiled successfully. We are trying to cross compile the same project for AM335x using the toolchain gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf and gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf....

About linux : cant-make-riscv-gnu-toolchain-make–jnproc-on-Arch-Linux

Question Detail I’m building the riscv-gnu-toolchain here on the latest Arch Linux. https://github.com/riscv-collab/riscv-gnu-toolchain like this: sudo pacman -Syyu autoconf automake curl python3 libmpc mpfr gmp gawk base-devel bison flex texinfo gperf libtool patchutils bc...

About linux : Compiling-GCC-1220-fails

Question Detail I’ve been following instructions from https://www.linuxfromscratch.org/lfs/view/stable-systemd/chapter05/gcc-pass1.html, but compiling GCC fails with the error /usr/bin/ld: ../build-x86_64-pc-linux-gnu/libiberty/libiberty.a(md5.o): relocation R_X86_64_32 against `.rodata’ can not be used when making a PIE object; recompile with -fPIE /usr/bin/ld:...