Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

1 votes
2 answers
56 views
How can I set up Environment Modules on my personal Linux machine to manage multiple compiler versions?
I’m an RSE working on a personal Linux machine and need to manage multiple compiler and MPI versions (e.g., GCC, Clang, Intel). I’m looking to use Lmod or Environment Modules to load and switch toolchains cleanly without manually managing environment variables. Goals: - Install and manage multiple c...
I’m an RSE working on a personal Linux machine and need to manage multiple compiler and MPI versions (e.g., GCC, Clang, Intel). I’m looking to use Lmod or Environment Modules to load and switch toolchains cleanly without manually managing environment variables. Goals: - Install and manage multiple compiler/MPI versions without conflict - Load/unload specific toolchains using module load/unload - Use a personal ~/modulefiles/ directory for modulefiles - Avoid hard-coded paths in .bashrc/.zshrc Setup: - Distro: rocky Linux - Software installed under custom prefixes like /home/user/pkg/gcc/10.2/ - Planning to use Lmod or environment-modules with a personal MODULEPATH Questions: 1. What’s the cleanest setup for Lmod on a personal (non-HPC) system? 2. How should I structure and load my personal modulefiles directory? 3. Are there simple examples of modulefiles for compilers or MPI? 4. How do I handle module version conflicts or dependencies with Lmod? I’ve read the official docs, but most examples assume a shared HPC setup. I’m looking for practical advice or examples tailored to single-user, personal setups.
Roberto_1986 (111 rep)
Jul 12, 2025, 10:23 AM • Last activity: Jul 16, 2025, 11:11 PM
4 votes
1 answers
110 views
Bootstrapping a C++ compiler from a C compiler on Linux
I am curious how to bootstrap a C++ compiler from a C compiler on Linux (x86-64 if the architecture is relevant). It is okay if not every C compiler is supported. For example a solution that works for GCC and Clang, but not for TCC or PCC would be fine. The standard build tools `make`, `ranlib`, &c...
I am curious how to bootstrap a C++ compiler from a C compiler on Linux (x86-64 if the architecture is relevant). It is okay if not every C compiler is supported. For example a solution that works for GCC and Clang, but not for TCC or PCC would be fine. The standard build tools make, ranlib, &c are all fair game, but for example a Rust compiler would not be. --------------------------------------------------- I am especially curious if there is a *maintained* way to do this. For example, a patch series on top of GCC 4.8 that builds on modern systems. I tried to take an old release of GCC from before the switch to C++ and tried to patch it to get it to compile on a modern Debian-based virtual machine. Most of the problems are shallow enough to fix with small patches here and there, and I could compile the GCC 4.8 C compiler. However, I ran into a major issue with libunwind, shown below. I think there's been some nontrivial change to way the libunwind headers work (GCC internally has a process for massaging system headers into the expected state, but it appears somewhat delicate). Here is an example error. I don't really expect this to be useful except for illustration purposes.
In file included from ../../.././libgcc/../gcc/unwind-dw2.c:337:0:
../../.././libgcc/../gcc/config/i386/linux-unwind.h: In function ‘x86_fallback_frame_state’:
../../.././libgcc/../gcc/config/i386/linux-unwind.h:138:17: error: field ‘info’ has incomplete type
../../.././libgcc/../gcc/config/i386/linux-unwind.h:139:18: error: field ‘uc’ has incomplete type
I don't need good performance, and I tried to find a way to get GCC to either disable exception handling entirely (this is fine, LLVM for example compiles with -fno-exceptions so I can bootstrap that with my trimmed down GCC) or use a different strategy for exception handling. At about this point, I decided to give up. So, is there a maintained way to get a C++ compiler from a C compiler?
Greg Nisbet (3156 rep)
Mar 23, 2025, 06:24 PM • Last activity: Mar 25, 2025, 05:45 AM
23 votes
3 answers
6176 views
Are compiled shell scripts better for performance?
After some googling, I found a way to compile BASH scripts to binary executables (using `shc`). I know that shell is an interpreted language, but what does this compiler do? Will it improve the performance of my script in any way?
After some googling, I found a way to compile BASH scripts to binary executables (using shc). I know that shell is an interpreted language, but what does this compiler do? Will it improve the performance of my script in any way?
adazem009 (661 rep)
Oct 20, 2020, 08:00 AM • Last activity: Jan 24, 2025, 11:28 AM
0 votes
1 answers
83 views
Are gcc and g++ now distinct executables?
According to comments and accepted answers linked below, gcc and g++ are the same executable. Because they are the same, the value of `argv[0]` will determine behavior, whether the argument is "gcc" or "g++". [See accepted answer][1] [Some comments here seem to confirm but some seem like they might...
According to comments and accepted answers linked below, gcc and g++ are the same executable. Because they are the same, the value of argv will determine behavior, whether the argument is "gcc" or "g++". See accepted answer Some comments here seem to confirm but some seem like they might hint at separate executables However, I see different inode numbers (and file sizes) for the two.
owner@fedora:~/code/make_test$ ls -ilh /usr/bin/gcc
1584205 -rwxr-xr-x. 3 root root 1020K May 21 17:00 /usr/bin/gcc
owner@fedora:~/code/make_test$ ls -ilh /usr/bin/g++
1584212 -rwxr-xr-x. 4 root root 1.0M May 21 17:00 /usr/bin/g++
I happened to observe the following when compiling a hello_world.cpp program with the -v flag: gcc version 13.3.1 20240522 (Red Hat 13.3.1-1) (GCC) I considered the possibility that Red Hat implemented their own gcc with their own idioms, but it does not appear that my gcc installation comes from any nonstandard repo. I'm using Fedora 39 and did not expect to see Red Hat content in my OS (although I don't see why RH content could not have been merged into an upstream distro at some point).
owner@fedora:~/code/make_test$ dnf repolist
repo id                                                                                                       repo name
fedora                                                                                                        Fedora 39 - x86_64
fedora-cisco-openh264                                                                                         Fedora 39 openh264 (From Cisco) - x86_64
opera                                                                                                         Opera packages
rpmfusion-free                                                                                                RPM Fusion for Fedora 39 - Free
rpmfusion-free-updates                                                                                        RPM Fusion for Fedora 39 - Free - Updates
rpmfusion-nonfree                                                                                             RPM Fusion for Fedora 39 - Nonfree
rpmfusion-nonfree-updates                                                                                     RPM Fusion for Fedora 39 - Nonfree - Updates
updates                                                                                                       Fedora 39 - x86_64 - Updates

owner@fedora:~/code/make_test$ dnf whatprovides gcc
Last metadata expiration check: 0:02:01 ago on Tue 30 Jul 2024 08:16:27 PM MST.
gcc-13.2.1-3.fc39.x86_64 : Various compilers (C, C++, Objective-C, ...)
Repo        : fedora
Matched from:
Provide    : gcc = 13.2.1-3.fc39

gcc-13.3.1-1.fc39.x86_64 : Various compilers (C, C++, Objective-C, ...)
Repo        : @System
Matched from:
Provide    : gcc = 13.3.1-1.fc39

gcc-13.3.1-1.fc39.x86_64 : Various compilers (C, C++, Objective-C, ...)
Repo        : updates
Matched from:
Provide    : gcc = 13.3.1-1.fc39
So, I believe I have the "official" gcc and I do not understand why gcc and g++ are not the same file. Are gcc and g++ now distinct executables, have they always been distinct, and if not when did they split? Or have I just been misinformed about them ever being the same?
PhillNo (3 rep)
Jul 31, 2024, 04:32 AM • Last activity: Jul 31, 2024, 07:42 AM
3 votes
2 answers
969 views
Current status of PCC (Portable C Compiler)?
PCC's current [website](http://pcc.ludd.ltu.se) (the development was taken over from the '70ies code from Stephen C. Johnson by Anders Magnusson, and mostly rewritten). It shows no activity in it's CVS repository ("cvs -d :pserver:anonymous@pcc.ludd.ltu.se:/cvsroot co pcc") since Sun May 19 01:00:02...
PCC's current [website](http://pcc.ludd.ltu.se) (the development was taken over from the '70ies code from Stephen C. Johnson by Anders Magnusson, and mostly rewritten). It shows no activity in it's CVS repository ("cvs -d :pserver:anonymous@pcc.ludd.ltu.se:/cvsroot co pcc") since Sun May 19 01:00:02 2019 +0000. Anybody know what is going on? Did the development move elsewhere?
vonbrand (18617 rep)
Aug 1, 2019, 05:07 PM • Last activity: Jul 25, 2024, 12:20 PM
0 votes
0 answers
99 views
ARM-LINUX-GCC with LIBMODBUS
[![enter image description here][1]][1] [![enter image description here][2]][2] [1]: https://i.sstatic.net/Lhsqe0Fd.png [2]: https://i.sstatic.net/63SRrnBM.png Hi everyone, I'm trying to compile a program using "**arm-linux-gcc**" with **"libmodbus"**; however it seems the compiler is not set up for...
enter image description here enter image description here Hi everyone, I'm trying to compile a program using "**arm-linux-gcc**" with **"libmodbus"**; however it seems the compiler is not set up for libmodbus. What should I do to fix it?
Tráng Đặng Đình (1 rep)
May 29, 2024, 03:13 AM
3 votes
1 answers
1673 views
Recover static library from executable
I have an existing executable for which a small amount of source code has been lost. In particular, the executable uses a few functions from a static library, and the source code for that library is missing. I do have an older version of that library's code, but the executable uses three or four met...
I have an existing executable for which a small amount of source code has been lost. In particular, the executable uses a few functions from a static library, and the source code for that library is missing. I do have an older version of that library's code, but the executable uses three or four methods that aren't in the old version. I have a header file for the new version of the code, which includes prototypes of the missing functions, but the .c file containing the actual function definitions is missing. Since the executable is statically linked, I wonder if there is a way to rebuild the static library by extracting the object code from it. I can find the symbols I need using nm and objdump, but I don't know if there's a way to extract those functions and re-package them into object files or a static library. As an example, it looks something like this:
$ nm ./theApplication

001721dc T _missingFunction1

00171ed8 T _missingFunction2


$ objdump --disassemble-all ./theApplication

00171ed8 :
  171ed8:       1a e5 f8 14     P2 = [P3 + 0x53e0];

001721dc :
  1721dc:       c5 04           [--SP] = (P5:5);
I'd like to pull missingFunction1() and missingFunction2() out into a static library or object files so I can link against them in other executables. Is that possible, and if so, how can it be done?
maldata (165 rep)
Nov 28, 2019, 08:14 PM • Last activity: Mar 3, 2024, 06:26 AM
1 votes
1 answers
355 views
Compiling GCC failed on Openbsd 7.4 (configure: error: .... libgomp)
I'm yak shaving: to compile `gcc` (especially with `libgccjit` for ultimately compiling `emacs` with `native-comp`) on openbsd 7.4. The reason behind is `libgccjit` isn't available via `pkg_add`. Thus I'm trying to compile `gcc` from source. I'm loosely following this [article](https://iq.opengenus....
I'm yak shaving: to compile gcc (especially with libgccjit for ultimately compiling emacs with native-comp) on openbsd 7.4. The reason behind is libgccjit isn't available via pkg_add. Thus I'm trying to compile gcc from source. I'm loosely following this [article](https://iq.opengenus.org/build-gcc-from-source/) . So I'm facing following error message while I'm running $gmake -j 4. (at this time I didn't even included jit in the configuration flags yet).
checking for gawk... awk
checking whether gmake sets $(MAKE)... yes
checking whether gmake supports nested variables... yes
checking for x86_64-unknown-openbsd7.4-gcc... /home/garid/otherGit/objdir/./gcc/xgcc -B/home/garid/otherGit/objdir/./gcc/ -B/home/garid/MyCompiledGCCpath/x86_64-unknown-openbsd7.4/bin/ -B/home/garid/MyCompiledGCCpath/x86_64-unknown-openbsd7.4/lib/ -isystem /home/garid/MyCompiledGCCpath/x86_64-unknown-openbsd7.4/include -isystem /home/garid/MyCompiledGCCpath/x86_64-unknown-openbsd7.4/sys-include   -fno-checking
checking whether the C compiler works... no
configure: error: in `/home/garid/otherGit/objdir/x86_64-unknown-openbsd7.4/libgomp':
configure: error: C compiler cannot create executables
See `config.log' for more details
gmake: *** [Makefile:26314: configure-stage1-target-libgomp] Error 77
gmake: Leaving directory '/home/garid/otherGit/objdir'
gmake: *** [Makefile:28686: stage1-bubble] Error 2
gmake: Leaving directory '/home/garid/otherGit/objdir'
gmake: *** [Makefile:1077: all] Error 2
And following is my config.log as error suggested to read for the details.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ /home/garid/otherGit/objdir/../gcc/configure --prefix=/home/garid/MyCompiledGCCpath --enable-host-shared --enable-languages=c,c++

## --------- ##
## Platform. ##
## --------- ##

hostname = openbased
uname -m = amd64
uname -r = 7.4
uname -s = OpenBSD
uname -v = GENERIC.MP#1397

/usr/bin/uname -p = amd64
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = OpenBSD.amd64
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/X11R6/bin
PATH: /usr/local/bin
PATH: /usr/local/sbin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2378: checking build system type
configure:2392: result: x86_64-unknown-openbsd7.4
configure:2439: checking host system type
configure:2452: result: x86_64-unknown-openbsd7.4
configure:2472: checking target system type
configure:2485: result: x86_64-unknown-openbsd7.4
configure:2539: checking for a BSD-compatible install
configure:2607: result: /usr/bin/install -c
configure:2618: checking whether ln works
configure:2640: result: yes
configure:2644: checking whether ln -s works
configure:2648: result: yes
configure:2655: checking for a sed that does not truncate output
configure:2719: result: /usr/bin/sed
configure:2728: checking for gawk
configure:2758: result: no
configure:2728: checking for mawk
configure:2758: result: no
configure:2728: checking for nawk
configure:2758: result: no
configure:2728: checking for awk
configure:2744: found /usr/bin/awk
configure:2755: result: awk
configure:3256: checking for libatomic support
configure:3266: result: yes
configure:3294: checking for libitm support
configure:3304: result: yes
configure:3313: checking for libsanitizer support
configure:3319: result: no
configure:3332: checking for libvtv support
configure:3338: result: no
configure:3462: checking for libphobos support
configure:3468: result: no
configure:4184: checking for gcc
configure:4214: result: no
configure:4277: checking for cc
configure:4298: found /usr/bin/cc
configure:4321: result: cc
configure:4440: checking for C compiler version
configure:4449: cc --version >&5
OpenBSD clang version 13.0.0
Target: amd64-unknown-openbsd7.4
Thread model: posix
InstalledDir: /usr/bin
configure:4460: $? = 0
configure:4449: cc -v >&5
OpenBSD clang version 13.0.0
Target: amd64-unknown-openbsd7.4
Thread model: posix
InstalledDir: /usr/bin
configure:4460: $? = 0
configure:4449: cc -V >&5
cc: error: argument to '-V' is missing (expected 1 value)
cc: error: no input files
configure:4460: $? = 1
configure:4449: cc -qversion >&5
cc: error: unknown argument '-qversion'; did you mean '--version'?
cc: error: no input files
configure:4460: $? = 1
configure:4480: checking whether the C compiler works
configure:4502: cc    conftest.c  >&5
configure:4506: $? = 0
configure:4554: result: yes
configure:4557: checking for C compiler default output file name
configure:4559: result: a.out
configure:4565: checking for suffix of executables
configure:4572: cc -o conftest    conftest.c  >&5
configure:4576: $? = 0
configure:4598: result: 
configure:4620: checking whether we are cross compiling
configure:4628: cc -o conftest    conftest.c  >&5
configure:4632: $? = 0
configure:4639: ./conftest
configure:4643: $? = 0
configure:4658: result: no
configure:4663: checking for suffix of object files
configure:4685: cc -c   conftest.c >&5
configure:4689: $? = 0
configure:4710: result: o
configure:4714: checking whether we are using the GNU C compiler
configure:4733: cc -c   conftest.c >&5
configure:4733: $? = 0
configure:4742: result: yes
configure:4751: checking whether cc accepts -g
configure:4771: cc -c -g  conftest.c >&5
configure:4771: $? = 0
configure:4812: result: yes
configure:4829: checking for cc option to accept ISO C89
configure:4892: cc  -c -g -O2  conftest.c >&5
configure:4892: $? = 0
configure:4905: result: none needed
configure:4925: checking for cc option to accept ISO C99
configure:5074: cc  -c -g -O2  conftest.c >&5
configure:5074: $? = 0
configure:5087: result: none needed
configure:5160: checking for g++
configure:5190: result: no
configure:5160: checking for c++
configure:5176: found /usr/bin/c++
configure:5187: result: c++
configure:5214: checking for C++ compiler version
configure:5223: c++ --version >&5
OpenBSD clang version 13.0.0
Target: amd64-unknown-openbsd7.4
Thread model: posix
InstalledDir: /usr/bin
configure:5234: $? = 0
configure:5223: c++ -v >&5
OpenBSD clang version 13.0.0
Target: amd64-unknown-openbsd7.4
Thread model: posix
InstalledDir: /usr/bin
configure:5234: $? = 0
configure:5223: c++ -V >&5
c++: error: argument to '-V' is missing (expected 1 value)
c++: error: no input files
configure:5234: $? = 1
configure:5223: c++ -qversion >&5
c++: error: unknown argument '-qversion'; did you mean '--version'?
c++: error: no input files
configure:5234: $? = 1
configure:5238: checking whether we are using the GNU C++ compiler
configure:5257: c++ -c   conftest.cpp >&5
configure:5257: $? = 0
configure:5266: result: yes
configure:5275: checking whether c++ accepts -g
configure:5295: c++ -c -g  conftest.cpp >&5
configure:5295: $? = 0
configure:5336: result: yes
configure:5385: checking whether g++ accepts -static-libstdc++ -static-libgcc
configure:5402: c++ -o conftest -g -O2   -static-libstdc++ -static-libgcc conftest.cpp  >&5
c++: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
c++: warning: argument unused during compilation: '-static-libgcc' [-Wunused-command-line-argument]
conftest.cpp:11:2: error: -static-libstdc++ not implemented
#error -static-libstdc++ not implemented
 ^
1 error generated.
configure:5402: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
| #error -static-libstdc++ not implemented
| #endif
| int main() {}
configure:5406: result: no
configure:5467: checking for gnatbind
configure:5497: result: no
configure:5559: checking for gnatmake
configure:5589: result: no
configure:5608: checking whether compiler driver understands Ada
configure:5631: result: no
configure:5685: checking for gdc
configure:5715: result: no
configure:5734: checking whether the D compiler works
configure:5751: result: no
configure:5759: checking how to compare bootstrapped objects
configure:5784: result: cmp $$f1 $$f2 16 16
configure:7928: checking for objdir
configure:7943: result: .libs
configure:8475: WARNING: using in-tree isl, disabling version check
configure:9655: checking for default BUILD_CONFIG
configure:9687: result: 
configure:9692: checking for --enable-vtable-verify
configure:9705: result: no
configure:10341: checking for bison
configure:10371: result: no
configure:10341: checking for byacc
configure:10371: result: no
configure:10341: checking for yacc
configure:10357: found /usr/bin/yacc
configure:10368: result: yacc
configure:10388: checking for bison
configure:10418: result: no
configure:10435: checking for gm4
configure:10465: result: no
configure:10435: checking for gnum4
configure:10465: result: no
configure:10435: checking for m4
configure:10451: found /usr/bin/m4
configure:10462: result: m4
configure:10482: checking for flex
configure:10498: found /usr/bin/flex
configure:10509: result: flex
configure:10530: checking for flex
configure:10546: found /usr/bin/flex
configure:10557: result: flex
configure:10577: checking for makeinfo
configure:10593: found /usr/bin/makeinfo
configure:10604: result: makeinfo
configure:10638: checking for expect
configure:10668: result: no
configure:10687: checking for runtest
configure:10717: result: no
configure:10832: checking for ar
configure:10848: found /usr/bin/ar
configure:10859: result: ar
configure:10973: checking for as
configure:10989: found /usr/bin/as
configure:11000: result: as
configure:11114: checking for dlltool
configure:11144: result: no
configure:11255: checking for dsymutil
configure:11285: result: no
configure:11315: checking for ld
configure:11342: result: /usr/bin/ld
configure:11537: checking for lipo
configure:11567: result: no
configure:11678: checking for nm
configure:11694: found /usr/bin/nm
configure:11705: result: nm
configure:11819: checking for ranlib
configure:11835: found /usr/bin/ranlib
configure:11846: result: ranlib
configure:11955: checking for strip
configure:11971: found /usr/bin/strip
configure:11982: result: strip
configure:12091: checking for windres
configure:12121: result: no
configure:12232: checking for windmc
configure:12262: result: no
configure:12373: checking for objcopy
configure:12389: found /usr/bin/objcopy
configure:12400: result: objcopy
configure:12514: checking for objdump
configure:12530: found /usr/bin/objdump
configure:12541: result: objdump
configure:12655: checking for otool
configure:12685: result: no
configure:12796: checking for readelf
configure:12812: found /usr/bin/readelf
configure:12823: result: readelf
configure:12978: checking for cc
configure:12994: found /usr/bin/cc
configure:13005: result: cc
configure:13139: checking for c++
configure:13155: found /usr/bin/c++
configure:13166: result: c++
configure:13300: checking for gcc
configure:13330: result: no
configure:13456: checking for gfortran
configure:13486: result: no
configure:13617: checking for gccgo
configure:13647: result: no
configure:13778: checking for gdc
configure:13808: result: no
configure:13869: checking for ar
configure:13902: result: no
configure:14019: checking for ar
configure:14035: found /usr/bin/ar
configure:14046: result: ar
configure:14099: checking for as
configure:14132: result: no
configure:14249: checking for as
configure:14265: found /usr/bin/as
configure:14276: result: as
configure:14329: checking for dlltool
configure:14362: result: no
configure:14479: checking for dlltool
configure:14509: result: no
configure:14559: checking for dsymutil
configure:14592: result: no
configure:14709: checking for dsymutil
configure:14739: result: no
configure:14789: checking for ld
configure:14822: result: no
configure:14939: checking for ld
configure:14955: found /usr/bin/ld
configure:14966: result: ld
configure:15019: checking for lipo
configure:15052: result: no
configure:15169: checking for lipo
configure:15199: result: no
configure:15249: checking for nm
configure:15282: result: no
configure:15399: checking for nm
configure:15415: found /usr/bin/nm
configure:15426: result: nm
configure:15479: checking for objcopy
configure:15512: result: no
configure:15629: checking for objcopy
configure:15645: found /usr/bin/objcopy
configure:15656: result: objcopy
configure:15709: checking for objdump
configure:15742: result: no
configure:15859: checking for objdump
configure:15875: found /usr/bin/objdump
configure:15886: result: objdump
configure:15939: checking for otool
configure:15972: result: no
configure:16089: checking for otool
configure:16119: result: no
configure:16169: checking for ranlib
configure:16202: result: no
configure:16319: checking for ranlib
configure:16335: found /usr/bin/ranlib
configure:16346: result: ranlib
configure:16399: checking for readelf
configure:16432: result: no
configure:16549: checking for readelf
configure:16565: found /usr/bin/readelf
configure:16576: result: readelf
configure:16629: checking for strip
configure:16662: result: no
configure:16779: checking for strip
configure:16795: found /usr/bin/strip
configure:16806: result: strip
configure:16859: checking for windres
configure:16892: result: no
configure:17009: checking for windres
configure:17039: result: no
configure:17089: checking for windmc
configure:17122: result: no
configure:17239: checking for windmc
configure:17269: result: no
configure:17297: checking where to find the target ar
configure:17330: result: host tool
configure:17339: checking where to find the target as
configure:17372: result: host tool
configure:17381: checking where to find the target cc
configure:17404: result: just compiled
configure:17423: checking where to find the target c++
configure:17449: result: just compiled
configure:17468: checking where to find the target c++ for libstdc++
configure:17494: result: just compiled
configure:17513: checking where to find the target dlltool
configure:17546: result: host tool
configure:17555: checking where to find the target dsymutil
configure:17577: result: host tool
configure:17586: checking where to find the target gcc
configure:17609: result: just compiled
configure:17628: checking where to find the target gfortran
configure:17664: result: host tool
configure:17673: checking where to find the target gccgo
configure:17709: result: host tool
configure:17718: checking where to find the target gdc
configure:17754: result: host tool
configure:17763: checking where to find the target ld
configure:17796: result: host tool
configure:17805: checking where to find the target lipo
configure:17827: result: host tool
configure:17836: checking where to find the target nm
configure:17869: result: host tool
configure:17878: checking where to find the target objcopy
configure:17911: result: host tool
configure:17920: checking where to find the target objdump
configure:17953: result: host tool
configure:17962: checking where to find the target otool
configure:17984: result: host tool
configure:17993: checking where to find the target ranlib
configure:18026: result: host tool
configure:18035: checking where to find the target readelf
configure:18068: result: host tool
configure:18077: checking where to find the target strip
configure:18110: result: host tool
configure:18119: checking where to find the target windres
configure:18152: result: host tool
configure:18161: checking where to find the target windmc
configure:18194: result: host tool
configure:18231: checking whether to enable maintainer-specific portions of Makefiles
configure:18240: result: no
configure:18483: creating ./config.status

## ---------------------- ##
## Running config.status. ##
## ---------------------- ##

This file was extended by config.status, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  CONFIG_FILES    = 
  CONFIG_HEADERS  = 
  CONFIG_LINKS    = 
  CONFIG_COMMANDS = 
  $ ./config.status 

on openbased

config.status:1077: creating Makefile

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-unknown-openbsd7.4
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_AR_FOR_TARGET_set=
ac_cv_env_AR_FOR_TARGET_value=
ac_cv_env_AR_set=
ac_cv_env_AR_value=
ac_cv_env_AS_FOR_TARGET_set=
ac_cv_env_AS_FOR_TARGET_value=
ac_cv_env_AS_set=
ac_cv_env_AS_value=
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_FOR_TARGET_set=
ac_cv_env_CC_FOR_TARGET_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_FOR_TARGET_set=
ac_cv_env_CXX_FOR_TARGET_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_DLLTOOL_FOR_TARGET_set=
ac_cv_env_DLLTOOL_FOR_TARGET_value=
ac_cv_env_DLLTOOL_set=
ac_cv_env_DLLTOOL_value=
ac_cv_env_DSYMUTIL_FOR_TARGET_set=
ac_cv_env_DSYMUTIL_FOR_TARGET_value=
ac_cv_env_DSYMUTIL_set=
ac_cv_env_DSYMUTIL_value=
ac_cv_env_GCC_FOR_TARGET_set=
ac_cv_env_GCC_FOR_TARGET_value=
ac_cv_env_GDC_FOR_TARGET_set=
ac_cv_env_GDC_FOR_TARGET_value=
ac_cv_env_GFORTRAN_FOR_TARGET_set=
ac_cv_env_GFORTRAN_FOR_TARGET_value=
ac_cv_env_GOC_FOR_TARGET_set=
ac_cv_env_GOC_FOR_TARGET_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LD_FOR_TARGET_set=
ac_cv_env_LD_FOR_TARGET_value=
ac_cv_env_LD_set=
ac_cv_env_LD_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LIPO_FOR_TARGET_set=
ac_cv_env_LIPO_FOR_TARGET_value=
ac_cv_env_LIPO_set=
ac_cv_env_LIPO_value=
ac_cv_env_NM_FOR_TARGET_set=
ac_cv_env_NM_FOR_TARGET_value=
ac_cv_env_NM_set=
ac_cv_env_NM_value=
ac_cv_env_OBJCOPY_FOR_TARGET_set=
ac_cv_env_OBJCOPY_FOR_TARGET_value=
ac_cv_env_OBJCOPY_set=
ac_cv_env_OBJCOPY_value=
ac_cv_env_OBJDUMP_FOR_TARGET_set=
ac_cv_env_OBJDUMP_FOR_TARGET_value=
ac_cv_env_OBJDUMP_set=
ac_cv_env_OBJDUMP_value=
ac_cv_env_OTOOL_FOR_TARGET_set=
ac_cv_env_OTOOL_FOR_TARGET_value=
ac_cv_env_OTOOL_set=
ac_cv_env_OTOOL_value=
ac_cv_env_RANLIB_FOR_TARGET_set=
ac_cv_env_RANLIB_FOR_TARGET_value=
ac_cv_env_RANLIB_set=
ac_cv_env_RANLIB_value=
ac_cv_env_READELF_FOR_TARGET_set=
ac_cv_env_READELF_FOR_TARGET_value=
ac_cv_env_READELF_set=
ac_cv_env_READELF_value=
ac_cv_env_STRIP_FOR_TARGET_set=
ac_cv_env_STRIP_FOR_TARGET_value=
ac_cv_env_STRIP_set=
ac_cv_env_STRIP_value=
ac_cv_env_WINDMC_FOR_TARGET_set=
ac_cv_env_WINDMC_FOR_TARGET_value=
ac_cv_env_WINDMC_set=
ac_cv_env_WINDMC_value=
ac_cv_env_WINDRES_FOR_TARGET_set=
ac_cv_env_WINDRES_FOR_TARGET_value=
ac_cv_env_WINDRES_set=
ac_cv_env_WINDRES_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_build_configargs_set=
ac_cv_env_build_configargs_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_host_configargs_set=
ac_cv_env_host_configargs_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_env_target_configargs_set=
ac_cv_env_target_configargs_value=
ac_cv_host=x86_64-unknown-openbsd7.4
ac_cv_objext=o
ac_cv_path_SED=/usr/bin/sed
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AR=ar
ac_cv_prog_AR_FOR_TARGET=ar
ac_cv_prog_AS=as
ac_cv_prog_AS_FOR_TARGET=as
ac_cv_prog_AWK=awk
ac_cv_prog_CC=cc
ac_cv_prog_CC_FOR_TARGET=cc
ac_cv_prog_CXX_FOR_TARGET=c++
ac_cv_prog_FLEX=flex
ac_cv_prog_LD=/usr/bin/ld
ac_cv_prog_LD_FOR_TARGET=ld
ac_cv_prog_LEX=flex
ac_cv_prog_M4=m4
ac_cv_prog_MAKEINFO=makeinfo
ac_cv_prog_NM=nm
ac_cv_prog_NM_FOR_TARGET=nm
ac_cv_prog_OBJCOPY=objcopy
ac_cv_prog_OBJCOPY_FOR_TARGET=objcopy
ac_cv_prog_OBJDUMP=objdump
ac_cv_prog_OBJDUMP_FOR_TARGET=objdump
ac_cv_prog_RANLIB=ranlib
ac_cv_prog_RANLIB_FOR_TARGET=ranlib
ac_cv_prog_READELF=readelf
ac_cv_prog_READELF_FOR_TARGET=readelf
ac_cv_prog_STRIP=strip
ac_cv_prog_STRIP_FOR_TARGET=strip
ac_cv_prog_YACC=yacc
ac_cv_prog_ac_ct_CXX=c++
ac_cv_prog_cc_c89=
ac_cv_prog_cc_c99=
ac_cv_prog_cc_g=yes
ac_cv_prog_cxx_g=yes
ac_cv_target=x86_64-unknown-openbsd7.4
acx_cv_cc_gcc_supports_ada=no
acx_cv_d_compiler_works=no
acx_cv_prog_LN=ln
gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16'
gcc_cv_tool_dirs=/home/garid/MyCompiledGCCpath/libexec/gcc/x86_64-unknown-openbsd7.4/12.2.0:/home/garid/MyCompiledGCCpath/libexec/gcc/x86_64-unknown-openbsd7.4:/usr/lib/gcc/x86_64-unknown-openbsd7.4/12.2.0:/usr/lib/gcc/x86_64-unknown-openbsd7.4:/home/garid/MyCompiledGCCpath/x86_64-unknown-openbsd7.4/bin/x86_64-unknown-openbsd7.4/12.2.0:/home/garid/MyCompiledGCCpath/x86_64-unknown-openbsd7.4/bin:
gcc_cv_tool_prefix=/home/garid/MyCompiledGCCpath
lt_cv_objdir=.libs

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR='ar'
AR_FOR_BUILD='$(AR)'
AR_FOR_TARGET='$(AR)'
AS='as'
AS_FOR_BUILD='$(AS)'
AS_FOR_TARGET='$(AS)'
AWK='awk'
BISON='/home/garid/otherGit/gcc/missing bison'
BUILD_CONFIG=''
CC='cc'
CC_FOR_BUILD='$(CC)'
CC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/'
CFLAGS='-g -O2'
CFLAGS_FOR_BUILD='-g -O2'
CFLAGS_FOR_TARGET='-g -O2'
COMPILER_AS_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/as'
COMPILER_LD_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/collect-ld'
COMPILER_NM_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/nm'
CONFIGURE_GDB_TK=''
CPPFLAGS=''
CPPFLAGS_FOR_BUILD=''
CPP_FOR_BUILD=''
CXX='c++ -std=c++11'
CXXFLAGS='-g -O2'
CXXFLAGS_FOR_BUILD='-g -O2'
CXXFLAGS_FOR_TARGET='-g -O2'
CXX_FOR_BUILD='$(CXX)'
CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs'
DEBUG_PREFIX_CFLAGS_FOR_TARGET=''
DEFS='-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DLT_OBJDIR=\".libs/\"'
DLLTOOL='dlltool'
DLLTOOL_FOR_BUILD='$(DLLTOOL)'
DLLTOOL_FOR_TARGET='$(DLLTOOL)'
DSYMUTIL='dsymutil'
DSYMUTIL_FOR_BUILD='$(DSYMUTIL)'
DSYMUTIL_FOR_TARGET='$(DSYMUTIL)'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
EXPECT='expect'
FLAGS_FOR_TARGET=' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
FLEX='flex'
GCC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/'
GCC_SHLIB_SUBDIR=''
GDB_TK=''
GDC='no'
GDCFLAGS=''
GDC_FOR_BUILD='$(GDC)'
GDC_FOR_TARGET='$(GDC)'
GFORTRAN_FOR_BUILD='$(GFORTRAN)'
GFORTRAN_FOR_TARGET='$(GFORTRAN)'
GNATBIND='no'
GNATMAKE='no'
GOC_FOR_BUILD='$(GOC)'
GOC_FOR_TARGET='$(GOC)'
HAVE_CXX11=''
HAVE_CXX11_FOR_BUILD=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_GDB_TK=''
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LD='/usr/bin/ld'
LDFLAGS=''
LDFLAGS_FOR_BUILD=''
LDFLAGS_FOR_TARGET=''
LD_FOR_BUILD='$(LD)'
LD_FOR_TARGET='$(LD)'
LEX='flex'
LIBOBJS=''
LIBS=''
LIPO='lipo'
LIPO_FOR_TARGET='$(LIPO)'
LN='ln'
LN_S='ln -s'
LTLIBOBJS=''
M4='m4'
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='makeinfo'
NM='nm'
NM_FOR_BUILD='$(NM)'
NM_FOR_TARGET='$(NM)'
OBJCOPY='objcopy'
OBJCOPY_FOR_TARGET='$(OBJCOPY)'
OBJDUMP='objdump'
OBJDUMP_FOR_TARGET='$(OBJDUMP)'
OBJEXT='o'
OTOOL='otool'
OTOOL_FOR_TARGET='$(OTOOL)'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PGO_BUILD_GEN_CFLAGS=''
PGO_BUILD_LTO_CFLAGS=''
PGO_BUILD_USE_CFLAGS=''
RANLIB='ranlib'
RANLIB_FOR_BUILD='$(RANLIB)'
RANLIB_FOR_TARGET='$(RANLIB)'
RAW_CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs'
READELF='readelf'
READELF_FOR_TARGET='$(READELF)'
RPATH_ENVVAR='LD_LIBRARY_PATH'
RUNTEST='runtest'
SED='/usr/bin/sed'
SHELL='/bin/sh'
STRIP='strip'
STRIP_FOR_TARGET='$(STRIP)'
SYSROOT_CFLAGS_FOR_TARGET=''
TOPLEVEL_CONFIGURE_ARGUMENTS='/home/garid/otherGit/objdir/../gcc/configure --prefix=/home/garid/MyCompiledGCCpath --enable-host-shared --enable-languages=c,c++'
WINDMC='windmc'
WINDMC_FOR_BUILD='$(WINDMC)'
WINDMC_FOR_TARGET='$(WINDMC)'
WINDRES='windres'
WINDRES_FOR_BUILD='$(WINDRES)'
WINDRES_FOR_TARGET='$(WINDRES)'
YACC='yacc'
ac_ct_CC=''
ac_ct_CXX='c++'
bindir='${exec_prefix}/bin'
build='x86_64-unknown-openbsd7.4'
build_alias=''
build_configargs=' --cache-file=./config.cache '\''--prefix=/home/garid/MyCompiledGCCpath'\'' '\''--enable-host-shared'\'' '\''--enable-languages=c,c++,lto'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking'
build_configdirs=' libiberty libcpp fixincludes'
build_cpu='x86_64'
build_libsubdir='build-x86_64-unknown-openbsd7.4'
build_noncanonical='x86_64-unknown-openbsd7.4'
build_os='openbsd7.4'
build_subdir='build-x86_64-unknown-openbsd7.4'
build_tooldir='${exec_prefix}/x86_64-unknown-openbsd7.4'
build_vendor='unknown'
compare_exclusions='gcc/cc*-checksum$(objext) | gcc/ada/*tools/*'
configdirs=' intl libiberty zlib libbacktrace libcpp libcody libdecnumber gmp mpfr mpc isl fixincludes gcc libcc1 c++tools lto-plugin'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
do_compare='cmp $$f1 $$f2 16 16'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='${prefix}'
extra_host_libiberty_configure_flags='--enable-shared'
extra_host_zlib_configure_flags=''
extra_isl_gmp_configure_flags='--with-gmp-builddir=$$r/$(HOST_SUBDIR)/gmp'
extra_liboffloadmic_configure_flags=''
extra_linker_plugin_configure_flags=''
extra_linker_plugin_flags=''
extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/.libs'
extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr/src --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/src/.libs'
extra_mpfr_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/.libs'
get_gcc_base_ver='cat'
gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp -I$$r/$(HOST_SUBDIR)/mpfr/src -I$$s/mpfr/src -I$$s/mpc/src '
gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/.libs -L$$r/$(HOST_SUBDIR)/mpfr/src/.libs -L$$r/$(HOST_SUBDIR)/mpc/src/.libs -lmpc -lmpfr -lgmp'
host='x86_64-unknown-openbsd7.4'
host_alias=''
host_configargs=' --cache-file=./config.cache  '\''--prefix=/home/garid/MyCompiledGCCpath'\'' '\''--enable-host-shared'\'' '\''--enable-languages=c,c++,lto'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking'
host_cpu='x86_64'
host_noncanonical='x86_64-unknown-openbsd7.4'
host_os='openbsd7.4'
host_shared='yes'
host_subdir='.'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
islinc='-I$$r/$(HOST_SUBDIR)/isl/include -I$$s/isl/include'
isllibs='-L$$r/$(HOST_SUBDIR)/isl/.libs  -lisl'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
poststage1_ldflags='-static-libstdc++ -static-libgcc'
poststage1_libs=''
prefix='/home/garid/MyCompiledGCCpath'
program_transform_name='s,y,y,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
stage1_cflags='-g'
stage1_checking='--enable-checking=yes,types'
stage1_languages='c,c++,lto'
stage1_ldflags=''
stage1_libs=''
stage2_werror_flag=''
sysconfdir='${prefix}/etc'
target='x86_64-unknown-openbsd7.4'
target_alias=''
target_configargs='--cache-file=./config.cache --enable-multilib   '\''--prefix=/home/garid/MyCompiledGCCpath'\'' '\''--enable-host-shared'\'' '\''--enable-languages=c,c++,lto'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking'
target_configdirs=' libgcc libgomp libatomic libitm libstdc++-v3 libssp libquadmath'
target_cpu='x86_64'
target_noncanonical='x86_64-unknown-openbsd7.4'
target_os='openbsd7.4'
target_subdir='x86_64-unknown-openbsd7.4'
target_vendor='unknown'
tooldir='${exec_prefix}/x86_64-unknown-openbsd7.4'

## ------------------- ##
## File substitutions. ##
## ------------------- ##

alphaieee_frag='/dev/null'
host_makefile_frag='/dev/null'
ospace_frag='/dev/null'
serialization_dependencies='serdep.tmp'
target_makefile_frag='/dev/null'

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define LT_OBJDIR ".libs/"

configure: exit 0
This is my first time on openbsd and first time to compile gcc. I don't know what I'm doing. Could anyone elaborate what I'm doing wrong.
Garid Z. (552 rep)
Oct 25, 2023, 08:49 AM • Last activity: Nov 6, 2023, 09:21 PM
70 votes
9 answers
107388 views
Can we get compiler information from an elf binary?
Is there some chance to know how a binary was built, under Linux? (and or other Unix) Compiler, version, time, flags etc... I looked at `readelf` and couldn't find much, but there might be other ways at analyzing the binary code/section etc... Anything you know how to extract?
Is there some chance to know how a binary was built, under Linux? (and or other Unix) Compiler, version, time, flags etc... I looked at readelf and couldn't find much, but there might be other ways at analyzing the binary code/section etc... Anything you know how to extract?
elmarco (1484 rep)
Aug 18, 2010, 05:58 PM • Last activity: Oct 22, 2023, 10:32 AM
0 votes
1 answers
258 views
Unable to use GTK on Debian, due to having libraries always be missing
Due to my laziness, I have downloaded precompiled binaries for GTK programmes (rather than compiling them which would have been a drag considering how time-wasting it is). ***EDIT:using sudo apt get, meaning it should probably be compatible*** I have downloaded a few of them, I think. I did download...
Due to my laziness, I have downloaded precompiled binaries for GTK programmes (rather than compiling them which would have been a drag considering how time-wasting it is). ***EDIT:using sudo apt get, meaning it should probably be compatible*** I have downloaded a few of them, I think. I did download one with "-dev" label and the one without. The programme I've tried executing was from "GeeksForGeeks" if I recall correctly. #include static int counter = 0; void greet(GtkWidget* widget, gpointer data) { // printf equivalent in GTK+ g_print("Welcome to GTK\n"); g_print("%s clicked %d times\n", (char*)data, ++counter); } void destroy(GtkWidget* widget, gpointer data) { gtk_main_quit(); } int main(int argc, char* argv[]) { GtkWidget* window; GtkWidget* button; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(window, "destroy", G_CALLBACK(destroy), NULL); /* Let's set the border width of the window to 20. * You may play with the value and see the * difference. */ gtk_container_set_border_width(GTK_CONTAINER(window), 20); button = gtk_button_new_with_label("Click Me!"); g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(greet), "button"); gtk_container_add(GTK_CONTAINER(window), button); gtk_widget_show_all(window); gtk_main(); return 0; } But right after copy-pasting it onto micro, before I saved it, I was met with error mentioning that there is no such directory such as gtk/gtk.h. I then proceeded to link the exact location of gtk.h. That one met me with an another error: gio.h I've tried google searching, but none of the results give me a working answer. I too hope this question is relevant to unix stackexchange as it's one on the subject of programming. The reason I am posting it in here is because it's mostly a problem closely connected to linux/unix system, rather than the code. The code is perfectly fine as to my knowledge. **P.S. As one can see in the screenshot, I did try linking the library and other stuff**
haruhisuzumiya (1 rep)
Mar 17, 2023, 10:07 PM • Last activity: Apr 19, 2023, 05:59 AM
0 votes
0 answers
125 views
What is the bootstrapping technique in terms of building cross-gcc and cross-glibc?
Some tutorials for building linux from ground do in first step building the cross compiler toolchain. They do this by invoking so called bootstrapping technique. First they build cross-gcc statically, then building with this static cross-gcc the cross-glibc library and only then they build the final...
Some tutorials for building linux from ground do in first step building the cross compiler toolchain. They do this by invoking so called bootstrapping technique. First they build cross-gcc statically, then building with this static cross-gcc the cross-glibc library and only then they build the final cross-gcc version, that will link all compiled programs for the target to this cross-glibc library. Question, why that? Why not directly building cross-gcc and cross-glibc with the host systems gcc? Is this step also only relevant for gcc/glibc? Are there other linux programs that has this back and forth story? Why for example binutils don't have this problems?
ptiza_v_nebe (83 rep)
Jan 28, 2023, 10:42 PM
39 votes
3 answers
15663 views
Do C compilers discard unused functions when statically linking to .a file?
Say I have a C program `main.c` that statically links to `libmine.a`. Statically linking to a library causes library functions to be embedded into the main executable at compile time. If `libmine.a` were to feature functions that weren't used by `main.c`, would the compiler (e.g. GCC) discard these...
Say I have a C program main.c that statically links to libmine.a. Statically linking to a library causes library functions to be embedded into the main executable at compile time. If libmine.a were to feature functions that weren't used by main.c, would the compiler (e.g. GCC) discard these functions? This question is inspired by the "common messaging" that using static libraries make executables larger, so I'm curious if the compiler at least strips away unused code from an archive file.
Izzo (1013 rep)
Sep 2, 2022, 12:14 PM • Last activity: Sep 3, 2022, 01:48 PM
2 votes
1 answers
7140 views
Specify which libstdc++ to use
I want to make use of a more recent GCC version. Therefore, I compiled GCC 10 and installed it into a non-standard directory `/software/gcc10/`. So far so good. However, I am faced with problems when I actually want to use this new version of GCC. I modified my `PATH` variable to include `/software/...
I want to make use of a more recent GCC version. Therefore, I compiled GCC 10 and installed it into a non-standard directory /software/gcc10/. So far so good. However, I am faced with problems when I actually want to use this new version of GCC. I modified my PATH variable to include /software/gcc10/bin/ such that gcc --version now confirms that the system finds my new GCC 10 compiler (instead of my system's GCC 8 one). However, when I try to compile a program with this setup, I get errors about undefined references to std::filesystem, which should be part of GCC 10's libstdc++. My assumption here is that while I am now using a more recent compiler, the linker still wants to link against my system's libstdc++ instead of that in /software/gcc10/lib64. I tried changing LD_LIBRARY_PATH to include the respective directory, but that doesn't seem to have any effect. Inspecting the output of running gcc with the -v option, I stumbled upon the LIBRARY_PATH environment variable, which according to [gcc's docs](https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html) is used as follows: > The value of LIBRARY_PATH is a colon-separated list of directories, much like PATH. When configured as a native compiler, GCC tries the directories thus specified when searching for special linker files, if it cannot find them using GCC_EXEC_PREFIX. Linking using GCC also uses these directories when searching for ordinary libraries for the -l option (but directories specified with -L come first). And indeed: Setting the LIBRARY_PATH variable accordingly allows me to compile my program successfully. However, it seems that this is a gcc-specific solution and I can't help but wonder whether there is a more standard way of doing this (that would e.g. also tell clang where to look for the C++ standard library to link against)? Even better would be a solution that would cause my new GCC 10 compiler to always use the GCC 10 stdlib whilst invocation of the system's GCC 8 compiler would always link against the systems GCC 8 stdlib. Is there a way to tell a specific compiler binary that it has a specific stdlib that it should use?
Raven (813 rep)
Mar 16, 2022, 03:34 PM • Last activity: Mar 16, 2022, 03:46 PM
6 votes
2 answers
44578 views
gcc - error: no acceptable C compiler found in $PATH
I am trying to install GCC from source. I am following the instructions on the wiki at [https://gcc.gnu.org/wiki/InstallingGCC][1] and also on [this question on SO][2]. I am running into issues on the configure step when running: `$PWD/../gcc-4.6.2/configure --prefix=$HOME/gcc-4.6.2 ` I get the foll...
I am trying to install GCC from source. I am following the instructions on the wiki at https://gcc.gnu.org/wiki/InstallingGCC and also on this question on SO . I am running into issues on the configure step when running: $PWD/../gcc-4.6.2/configure --prefix=$HOME/gcc-4.6.2 I get the following output and error: checking whether ln works... yes checking whether ln -s works... yes checking for a sed that does not truncate output... /bin/sed checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking for libatomic support... yes checking for libcilkrts support... no checking for libitm support... yes checking for libsanitizer support... yes checking for libvtv support... yes checking for libmpx support... no checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/usr/bin/objdir': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details. I appears as if the error is because there is no C compiler installed. This confuses me because isn't installing a C compiler what installing GCC is supposed to do? All the solutions I can find for this error say that I need to install GCC, so how can I install GCC if I need GCC installed to do it? I have updated my $PATH variable using export PATH=$PATH:/usr/bin/gcc-4.6.2 but it didn't help. I have also looked at this similar question without success: https://unix.stackexchange.com/questions/310669/c-compiler-while-installing-gcc **Is there something I am missing? What else can I do to get GCC installed?** NOTE: I can't just use yum or apt-get to install it because I am using a custom distribution that does not have those type of installer software installed.
Gerald Murphy (165 rep)
Jul 12, 2017, 08:04 PM • Last activity: Mar 16, 2022, 07:03 AM
0 votes
0 answers
196 views
Seeking thoughts on a weird error in printk.h
I am compiling a vendor provided proprietary test code for their device driver on rhel8.4, kernel version 4.18.0-305.10.2.el8_4.x86_64. Both the driver and the corresponding test code had been originally released for testing and deployment on rhel6.6. The compiler cribs about the following lines of...
I am compiling a vendor provided proprietary test code for their device driver on rhel8.4, kernel version 4.18.0-305.10.2.el8_4.x86_64. Both the driver and the corresponding test code had been originally released for testing and deployment on rhel6.6. The compiler cribs about the following lines of code in the system header file ``: static inline __printf(1, 2) __cold void early_printk(const char *s, ...) { } In accordance with the description provided in the following link for declaring the format attribute for functions Declaring Attributes of Functions there is a corresponding declaration in the system header file `` as shown below: #define __printf(a, b) __attribute__((format(printf, a, b))) The kernel forbids the direct inclusion of ` in source, and recommends indirect inclusion by means of `. The file ` has been included in the system header file , after the inclusion of . The header file provided with the proprietary vendor code includes `. Based on the above, one would expect the compiler to find the expansion for the format attribute in the aforementioned declaration in ``: static inline __printf(1, 2) __cold void early_printk(const char *s, ...) { } But instead, the compiler flags the format attribute as an error: /usr/src/kernels/4.18.0-305.10.2.el8_4.x86_64/include/linux/printk.h:145:24: error: expected declaration specifiers or ‘...’ before numeric constant static inline __printf(1, 2) __cold The following is the sequence of kernel system file inclusions inside `, leading up to the inclusion of `: #include #include #include #include #include #include #include #include #include #include I am using gcc version 8.4.1 20200928. Any thoughts would be appreciated.
Vinod (167 rep)
Sep 6, 2021, 04:29 AM
1 votes
0 answers
299 views
Debian Buster Freezing when Compiling Large Project
I've recently begun encountering an issue when attempting to compile a moderately large software project where my entire computer freezes. I can't get to another tty, I can't move the mouse. After some experimentation, I was able to replicate this freezing with other compilers and large projects so...
I've recently begun encountering an issue when attempting to compile a moderately large software project where my entire computer freezes. I can't get to another tty, I can't move the mouse. After some experimentation, I was able to replicate this freezing with other compilers and large projects so I don't suspect this issue is particular to my code or compiler. From what I can tell, the issue does appear to occur primarily when some other software (either a IDE linter, browser, etc.) is also taking up a fair amount of CPU. I've run top while inducing a freeze, and I will see two processes (one compiler and the "other") nearing 100% CPU, but neither process is actually using that much memory (at least according to top before it freezes). When the freeze occurs, the disk indicator light on my tower goes solid. Having looked into various potential fixes online related to memory, but none of the below seemed to work: * Deactivate swapping * Decrease swappiness * Increase required free RAM At present, I'm simply at a loss for what to do. I'm not even sure of what logs I can check or ways I can know the true cause of the unresponsiveness. Any and all assistance would be much appreciated.
LeqxLeqx (21 rep)
Aug 7, 2021, 04:48 PM
0 votes
1 answers
89 views
Seeking advice on source of compilation errors in kernel header files
As part of my current project, I am trying to compile some proprietary device drivers (originally compiled successfully for Redhat6 kernel version 2.6.32-504.el6.x86_64 using the vendor supplied Makefile which invokes gcc), on Redhat8. The kernel version that I am using is 4.18.0-240.15.1.el8_3.x86_...
As part of my current project, I am trying to compile some proprietary device drivers (originally compiled successfully for Redhat6 kernel version 2.6.32-504.el6.x86_64 using the vendor supplied Makefile which invokes gcc), on Redhat8. The kernel version that I am using is 4.18.0-240.15.1.el8_3.x86_64. The compilation results in a bunch of errors in system header files such as , et al. I do not wish to flood this post with specific errors, but rather what I am trying to figure out is **why is it that I am seeing the compilation errors in the kernel header files with an updated kernel version for the same driver code, which could be compiled successfully with an older kernel version as stated above?** Any thoughts would be highly appreciated. TIA
Vinod (167 rep)
Jun 30, 2021, 04:53 AM • Last activity: Jun 30, 2021, 05:04 AM
1 votes
2 answers
175 views
Portable name of C++ compiler (and linker)
cc is the POSIX name of the C compiler. Is there a general name of the C++ compiler (and linker). Notice that `g++` also adds some libraries, that will not be included when using plain gcc or ld.
cc is the POSIX name of the C compiler. Is there a general name of the C++ compiler (and linker). Notice that g++ also adds some libraries, that will not be included when using plain gcc or ld.
user877329 (761 rep)
May 26, 2021, 03:55 PM • Last activity: May 27, 2021, 01:49 PM
0 votes
1 answers
386 views
Debian : MPI code - Intel compiler - [Hardware Error]: Unified Memory Controller Error: DRAM ECC error
When running an executable compiled with `intel mpiicc`, I get, after 30 minutes of running, the following errors : kernel:[29585.573874] [Hardware Error]: Corrected error, no action required. Message from syslogd@pablo at Nov 8 09:53:25 ... kernel:[29585.573881] [Hardware Error]: CPU:2 (17:31:0) MC...
When running an executable compiled with intel mpiicc, I get, after 30 minutes of running, the following errors : kernel:[29585.573874] [Hardware Error]: Corrected error, no action required. Message from syslogd@pablo at Nov 8 09:53:25 ... kernel:[29585.573881] [Hardware Error]: CPU:2 (17:31:0) MC18_STATUS[Over|CE|MiscV|-|AddrV|-|-|SyndV|-|CECC]: 0xdc2041000000011b Message from syslogd@pablo at Nov 8 09:53:25 ... kernel:[29585.573887] [Hardware Error]: Error Addr: 0x0000000a6c12d280 Message from syslogd@pablo at Nov 8 09:53:25 ... kernel:[29585.573888] [Hardware Error]: IPID: 0x0000009600550f00, Syndrome: 0xc54c00040a800611 Message from syslogd@pablo at Nov 8 09:53:25 ... kernel:[29585.573891] [Hardware Error]: Unified Memory Controller Extended Error Code: 0 Message from syslogd@pablo at Nov 8 09:53:25 ... kernel:[29585.573893] [Hardware Error]: Unified Memory Controller Error: DRAM ECC error. Message from syslogd@pablo at Nov 8 09:53:25 ... kernel:[29585.573895] [Hardware Error]: cache level: L3/GEN, tx: GEN, mem-tx: RD I am working on a AMD EPYC 7702P 64-Core Processor with 1TB of RAM and a Debian OS : Linux pablo 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64 GNU/Linux From what I have seen, I did the command : dmidecode -t memory that gives : # dmidecode 3.2 Getting SMBIOS data from sysfs. SMBIOS 3.2.0 present. Handle 0x0023, DMI type 16, 23 bytes Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: Multi-bit ECC Maximum Capacity: 2 TB Error Information Handle: 0x0022 Number Of Devices: 8 Handle 0x002B, DMI type 17, 84 bytes Memory Device Array Handle: 0x0023 Error Information Handle: 0x002A Total Width: 72 bits Data Width: 64 bits Size: 128 GB Form Factor: DIMM Set: None Locator: DIMM 0 Bank Locator: P0 CHANNEL A Type: DDR4 Type Detail: Synchronous Registered (Buffered) LRDIMM Speed: 2933 MT/s Manufacturer: Samsung Serial Number: 03C6F701 Asset Tag: Not Specified Part Number: M386AAG40MMB-CVF Rank: 4 Configured Memory Speed: 2933 MT/s Minimum Voltage: 1.2 V Maximum Voltage: 1.2 V Configured Voltage: 1.2 V Memory Technology: DRAM Memory Operating Mode Capability: Volatile memory Firmware Version: Unknown Module Manufacturer ID: Bank 1, Hex 0xCE Module Product ID: Unknown Memory Subsystem Controller Manufacturer ID: Unknown Memory Subsystem Controller Product ID: Unknown Non-Volatile Size: None Volatile Size: 128 kB Cache Size: None Logical Size: None Handle 0x002E, DMI type 17, 84 bytes Memory Device Array Handle: 0x0023 Error Information Handle: 0x002D Total Width: 72 bits Data Width: 64 bits Size: 128 GB Form Factor: DIMM Set: None Locator: DIMM 0 Bank Locator: P0 CHANNEL B Type: DDR4 Type Detail: Synchronous Registered (Buffered) LRDIMM Speed: 2933 MT/s Manufacturer: Samsung Serial Number: 03C6F3ED Asset Tag: Not Specified Part Number: M386AAG40MMB-CVF Rank: 4 Configured Memory Speed: 2933 MT/s Minimum Voltage: 1.2 V Maximum Voltage: 1.2 V Configured Voltage: 1.2 V Memory Technology: DRAM Memory Operating Mode Capability: Volatile memory Firmware Version: Unknown Module Manufacturer ID: Bank 1, Hex 0xCE Module Product ID: Unknown Memory Subsystem Controller Manufacturer ID: Unknown Memory Subsystem Controller Product ID: Unknown Non-Volatile Size: None Volatile Size: 128 kB Cache Size: None Logical Size: None Handle 0x0031, DMI type 17, 84 bytes Memory Device Array Handle: 0x0023 Error Information Handle: 0x0030 Total Width: 72 bits Data Width: 64 bits Size: 128 GB Form Factor: DIMM Set: None Locator: DIMM 0 Bank Locator: P0 CHANNEL C Type: DDR4 Type Detail: Synchronous Registered (Buffered) LRDIMM Speed: 2933 MT/s Manufacturer: Samsung Serial Number: 03C6F4BA Asset Tag: Not Specified Part Number: M386AAG40MMB-CVF Rank: 4 Configured Memory Speed: 2933 MT/s Minimum Voltage: 1.2 V Maximum Voltage: 1.2 V Configured Voltage: 1.2 V Memory Technology: DRAM Memory Operating Mode Capability: Volatile memory Firmware Version: Unknown Module Manufacturer ID: Bank 1, Hex 0xCE Module Product ID: Unknown Memory Subsystem Controller Manufacturer ID: Unknown Memory Subsystem Controller Product ID: Unknown Non-Volatile Size: None Volatile Size: 128 kB Cache Size: None Logical Size: None Handle 0x0034, DMI type 17, 84 bytes Memory Device Array Handle: 0x0023 Error Information Handle: 0x0033 Total Width: 72 bits Data Width: 64 bits Size: 128 GB Form Factor: DIMM Set: None Locator: DIMM 0 Bank Locator: P0 CHANNEL D Type: DDR4 Type Detail: Synchronous Registered (Buffered) LRDIMM Speed: 2933 MT/s Manufacturer: Samsung Serial Number: 03C6F396 Asset Tag: Not Specified Part Number: M386AAG40MMB-CVF Rank: 4 Configured Memory Speed: 2933 MT/s Minimum Voltage: 1.2 V Maximum Voltage: 1.2 V Configured Voltage: 1.2 V Memory Technology: DRAM Memory Operating Mode Capability: Volatile memory Firmware Version: Unknown Module Manufacturer ID: Bank 1, Hex 0xCE Module Product ID: Unknown Memory Subsystem Controller Manufacturer ID: Unknown Memory Subsystem Controller Product ID: Unknown Non-Volatile Size: None Volatile Size: 128 kB Cache Size: None Logical Size: None Handle 0x0037, DMI type 17, 84 bytes Memory Device Array Handle: 0x0023 Error Information Handle: 0x0036 Total Width: 72 bits Data Width: 64 bits Size: 128 GB Form Factor: DIMM Set: None Locator: DIMM 0 Bank Locator: P0 CHANNEL E Type: DDR4 Type Detail: Synchronous Registered (Buffered) LRDIMM Speed: 2933 MT/s Manufacturer: Samsung Serial Number: 03C6F67D Asset Tag: Not Specified Part Number: M386AAG40MMB-CVF Rank: 4 Configured Memory Speed: 2933 MT/s Minimum Voltage: 1.2 V Maximum Voltage: 1.2 V Configured Voltage: 1.2 V Memory Technology: DRAM Memory Operating Mode Capability: Volatile memory Firmware Version: Unknown Module Manufacturer ID: Bank 1, Hex 0xCE Module Product ID: Unknown Memory Subsystem Controller Manufacturer ID: Unknown Memory Subsystem Controller Product ID: Unknown Non-Volatile Size: None Volatile Size: 128 kB Cache Size: None Logical Size: None Handle 0x003A, DMI type 17, 84 bytes Memory Device Array Handle: 0x0023 Error Information Handle: 0x0039 Total Width: 72 bits Data Width: 64 bits Size: 128 GB Form Factor: DIMM Set: None Locator: DIMM 0 Bank Locator: P0 CHANNEL F Type: DDR4 Type Detail: Synchronous Registered (Buffered) LRDIMM Speed: 2933 MT/s Manufacturer: Samsung Serial Number: 03C6F394 Asset Tag: Not Specified Part Number: M386AAG40MMB-CVF Rank: 4 Configured Memory Speed: 2933 MT/s Minimum Voltage: 1.2 V Maximum Voltage: 1.2 V Configured Voltage: 1.2 V Memory Technology: DRAM Memory Operating Mode Capability: Volatile memory Firmware Version: Unknown Module Manufacturer ID: Bank 1, Hex 0xCE Module Product ID: Unknown Memory Subsystem Controller Manufacturer ID: Unknown Memory Subsystem Controller Product ID: Unknown Non-Volatile Size: None Volatile Size: 128 kB Cache Size: None Logical Size: None Handle 0x003D, DMI type 17, 84 bytes Memory Device Array Handle: 0x0023 Error Information Handle: 0x003C Total Width: 72 bits Data Width: 64 bits Size: 128 GB Form Factor: DIMM Set: None Locator: DIMM 0 Bank Locator: P0 CHANNEL G Type: DDR4 Type Detail: Synchronous Registered (Buffered) LRDIMM Speed: 2933 MT/s Manufacturer: Samsung Serial Number: 03C6F48A Asset Tag: Not Specified Part Number: M386AAG40MMB-CVF Rank: 4 Configured Memory Speed: 2933 MT/s Minimum Voltage: 1.2 V Maximum Voltage: 1.2 V Configured Voltage: 1.2 V Memory Technology: DRAM Memory Operating Mode Capability: Volatile memory Firmware Version: Unknown Module Manufacturer ID: Bank 1, Hex 0xCE Module Product ID: Unknown Memory Subsystem Controller Manufacturer ID: Unknown Memory Subsystem Controller Product ID: Unknown Non-Volatile Size: None Volatile Size: 128 kB Cache Size: None Logical Size: None Handle 0x0040, DMI type 17, 84 bytes Memory Device Array Handle: 0x0023 Error Information Handle: 0x003F Total Width: 72 bits Data Width: 64 bits Size: 128 GB Form Factor: DIMM Set: None Locator: DIMM 0 Bank Locator: P0 CHANNEL H Type: DDR4 Type Detail: Synchronous Registered (Buffered) LRDIMM Speed: 2933 MT/s Manufacturer: Samsung Serial Number: 03C6F3FB Asset Tag: Not Specified Part Number: M386AAG40MMB-CVF Rank: 4 Configured Memory Speed: 2933 MT/s Minimum Voltage: 1.2 V Maximum Voltage: 1.2 V Configured Voltage: 1.2 V Memory Technology: DRAM Memory Operating Mode Capability: Volatile memory Firmware Version: Unknown Module Manufacturer ID: Bank 1, Hex 0xCE Module Product ID: Unknown Memory Subsystem Controller Manufacturer ID: Unknown Memory Subsystem Controller Product ID: Unknown Non-Volatile Size: None Volatile Size: 128 kB Cache Size: None Logical Size: None I don't know where these DRAM ECC error come from, Maybe there are incompatibilies between my motherboard, CPU model or bad version of Intel compiler SDK ? These errors appears roughly every 5 minutes during the execution. I am using the intel compilers version compilers_and_libraries_2020.1.217. **I have also the same error messages when I compile with MPI from official Open-MPI Debian 10 repository version.** I should modify maybe an option in the BIOS but I am not sure. If someone had an idea to solve this issue, this would be fine to tell it.
youpilat13 (1 rep)
Nov 8, 2020, 03:48 PM • Last activity: Nov 9, 2020, 01:53 PM
-4 votes
1 answers
1013 views
How can I name the output of a compiled source file in a certain way?
In terminal, I have compiled a source file named "file.C". I did this by typing g++ file.C -o file. Now, I'd like to know how can I use Unix commands to name the output as "helloworld.out"? Thank you in advance!
In terminal, I have compiled a source file named "file.C". I did this by typing g++ file.C -o file. Now, I'd like to know how can I use Unix commands to name the output as "helloworld.out"? Thank you in advance!
userh16xx0 (1 rep)
Oct 14, 2020, 09:27 PM • Last activity: Oct 14, 2020, 09:32 PM
Showing page 1 of 20 total questions