Can we configure gcc running on intel x64 architecture to produce binary for ARM chip by just passing some flags to gcc and not using a cross compiler.
Can gcc produce binary for Arm without cross compilation
1.7k Views Asked by mapuna At
1
There are 1 best solutions below
Related Questions in LINUX
- Is there some way to use printf to print a horizontal list of decrementing hex digits in NASM assembly on Linux
- Why does Hugo generate different taxonomy-related HTML on different OS's?
- Writes in io_uring do not advance the file offset
- Why `set -o pipefail` gives different output even though the pipe is not failing
- what really controls the permissions: UID or eUID?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Docker container unable to make HTTPS requests to external API
- Whow to use callback_query_handler in Python 3.10
- Create kea runtime directory at startup in Yocto image
- Problem on CPU scheduling algorithms in OS
- How to copy files into the singularity sandbox?
- Android kernel error: undefined reference to `get_hw_version_platform'
- Is there a need for BPF Linux namespace?
- Error when trying to execute a binary compiled in a Kali Linux machine on an Ubuntu system
- Issue with launching application after updating ElectronJs to version 28.0.0 on Windows and Linux
Related Questions in GCC
- File refuses to compile std::erase() even if using -std=g++23
- the difference between two style of inline ASM
- Why veneer code generated by gcc for cortex-m0 seems 8-byte aligned?
- How to compile the Linux kernel with -O0 for more detailed debug?
- GMP Windows installation "configure: error: could not find a working compiler"
- Unable to run get .exe file from assembly NASM
- Problem with compiling c++ project that is running python code using Python.h -> undefined reference
- How to use a newer linker and glibc in a Kotlin/Native project?
- "Config.guess failed to determine the host type" when trying build binutils-2.7 with Cygwin
- Trying to compile GCC returns a bunch of errors
- Compiling with gcc fno-common option causes performance degradation
- On cygwin I get errors containing -lintl and -liconv when running gcc
- Constant function pointer optimization
- How to obtain mingw-w64 version 9.3.0 or older for MSYS2?
- How to fix this error in terminal while writing hello world code in VS Code on C?
Related Questions in ARM
- Jiobook flashing
- How to flush denormal numbers to zero for apple silicon?
- How to exploit Unified Memory in OpenCL with CL_MEM_ALLOC_HOST_PTR flag?
- ARM Assembly code is not executing in Vitis IDE
- Which version of ARM does the M1 chip run on?
- Vector by Scalar Division with -ffast-math
- Why veneer code generated by gcc for cortex-m0 seems 8-byte aligned?
- Getting almost random time stamp counter on ARM
- Portenta H7 Baremetal Development and a Little Guidance on Embedded System Learning Roadmap
- STM32 RTC3 Mixed Mode: Writing TR resets SSR
- Implementing Quick Sort Algorithm in Visual2 with armv7
- How can I create an Inline assembly command with a multi-variable register offset?
- Inquiry: ARM Compatibility for Puppeteer
- Confusion with thumb instructions while compiling recipe for cortexm4 CPU
- Difficulty understanding virtual LPIs in GICv3
Related Questions in GNU-TOOLCHAIN
- gcc linking to standard library functions failing
- Unrecognized options while configuring newlib
- Running QEMU with support for RISC-V Vector Extensions
- Toolchain-gccarmnoneeabi-teensy error. Platformio project for teensy 4.1
- GNU ToolChains Cross Compiler c/C++library issue
- toolchains for cross-compilation of 32bit ARMv7-a platform
- "cannot compute suffix of object files" error occurs during the installation of RISCV toolchain
- (make) Recipes breaks after definding PATH
- Where is the source code from the WCH RISC-V toolchain?
- Error: unrecognized opcode `mul a0,t4,t5', extension `m' or `zmmul' required
- Inconsistent Binary Output When Building STM32CubeIDE Project on Linux and Windows
- I can't add custom instructions to RISC-V GNU GCC
- Use Makefile and sdcc to build a perfect automation for MCS-51 development
- Downloading gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu from source, failed building libc
- How to run GCC for ARM cross compiling in WSL2 via WINE?
Related Questions in LINUX-TOOLCHAIN
- ESP-IDF Standard Toolchain Setup for Linux failed with 6 errors like "ERROR: tool xtensa-esp32-elf has no installed versions."
- Cross-compiling a Qt application for Red Hat 7.4 on Windows 10
- how to alterate state in array object at v-for loop?
- How do I build a newlib RISC-V toolchain with a modified linker script?
- execvp: /bin/sh: Argument list too long while building glibc 2.5 with crosstool-ng
- seg fault when calling libc init
- KERNELCONFIG while building toolchain using crosstool-ng
- Building 64-bit MIPS Big endian cross-compiler toolchain
- Buildroot - menuconfig creates config, but won't make
- If the same code is built at different folders using arm-poky-linux-gnueabi-gcc, the resulting binary will have different contents
- What exactly is a toolchain?
- What is the difference between ar/nm and gcc-ar/gcc-nm?
- Newlib: embedded vs desktop
- Building GCC without mpc, mpfr and gmp
- Buildroot toolchain with openssl
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Short: Nope
Compiler: gcc is not a native crosscompiler, the target architecture has to be specified at the time you compile gcc. (Some exceptions apply, as for example x86 and x86_64 can be supported at the same time)
clang would be a native crosscompiler, and you can generate code for arm by passing -target=arm-linux-gnu, but you still cant produce binaries, as you need a linker and a C-library too. Means you can run
clang -target=arm-linux-gnu -c <your file>and compile C/C++ Code (will likely need to point it to your C/C++ include paths) - but you cant build binaries.Rest of the toolchain: You need a fitting linker and toolchain too, both are specific to the architecture and OS you want to run at.
Possible solutions: Get a fitting toolchain, or compile your own. For arm linux you have for ex. CrossToolchains if you are on debian, for barebones you can get a crosscompiler from codesourcery.
Since you were very vague, its not possible to give you a clearer answer