2,883 questions
Tooling
0
votes
7
replies
133
views
One liner to get distinct values of all columns of a tsv
I am looking for a one liner that could be run in a linux terminal that does the below.
Takes as input a tab separated file (tsv) with many columns (~100) and creates a two column tsv output with ...
2
votes
1
answer
121
views
Is there a robust way to version all exported symbols with version script without changing the visibility?
GNU documentation is really poor and is worded in a way that seem to imply that you can only assign version only to symbols that are listed explicitly either under global: or local:, but those are ...
0
votes
0
answers
45
views
How to configure GNU binutils for barel-metal ELF targets with additional PE/COFF support
I'm trying to configure the GNU binutils for x86_64 bare-metal ELF targets with additional PE/COFF binary format support. Need the tool-chain for operating system and EFI development for the purpose ...
0
votes
1
answer
90
views
Is it ok to use GNU tools on LLVM binaries?
In the process of my work, I need to build Linux versions of our codebase & release. The toolchain is LLVM/clang. I also have GNU tools installed on my system. I sometimes need to strip symbols ...
1
vote
1
answer
63
views
GNU Attribute "nonnull" and Custom Assert Conflict
Context
I have a custom assert defined, which looks something like:
[[gnu::noreturn]] [[gnu::visibility("internal")]]
void my_assert_handler(const char* condStr, const char* file, int line);
...
0
votes
1
answer
109
views
Issue with running virtual machines throught virt-manager from pacman
I successfully installed virt-manager through pacman on Parabola GNU/Linux-libre (based on Arch), but there are issues when installing or running a virtual machine. These problems do not occur when ...
0
votes
0
answers
60
views
How to resolve build error GCC-15.1.0 build error on TinyCorePure64
While building GCC-15.1.0 on
TinyCorePure64 version 16.12.11 in
Oracle VirtualBox Version 7.1.10 r169112 (Qt6.5.3) in
Windows 11 Home 24H2 - 26100.4351 on
AMD Ryzen 5 5625U Acer Aspire Thin & ...
3
votes
0
answers
63
views
Can the GNU Assembler perform all macro expansions in a file and then output compilable code without macros?
Is there a way to have the GNU assembly process a source file that contains macros, expand them, and then output the expanded equivalent code in a form that could be assembled by as? Basically, I'm ...
0
votes
0
answers
49
views
How to change the properties of a block in run time?
I am using the GNU radio for demodulation of signals.
I faced the problem of changing the block parameters in real time.
Let's say the Symbol Sync block, the Samples per Symbol parameter is not ...
0
votes
4
answers
164
views
How to use register_printf_specifier in a portable way?
I'm doing a collections library in C in which I implement several data structures that I want to be able to display directly with printf (for example I have a String struct that I want to be able to ...
0
votes
0
answers
47
views
How to get the location list value in DWARF 5 when DW_AT_GNU_locviews is present
I have a DIE that looks like this (output from llvm-dwarfdump):
DW_AT_Location [DW_FORM_sec_offset] (0x00000e65)
[0x000000001c1ef510, 0x00000000mc1ef530]
[0x000000001c1ef5d1, 0x00000000mc1ef5d5]
...
-1
votes
1
answer
151
views
Are `ln -f` and `ln -sf` atomic on Linux and POSIX? [closed]
On Linux, does ln --force atomically overwrite the target? In other words, during the time that ln --force runs, is it guaranteed that the file system is always either in the original state or in the ...
1
vote
1
answer
168
views
Get sizeof C-Symbol in GNU Linker script
I have a section in my linker script which needs to contain 2 things:
A variable length byte-array (used for heap)
A global variable called foo.
This can be done like this:
MEMORY {
APPL_STATE (...
0
votes
1
answer
68
views
GNU make only checks dependency once, whereas the dependency checking rule is a .PHONY and should be called twice?
For the below makefile:
NAME = file1
all: $(NAME)
$(NAME): dep1 dep2
touch $(NAME)
dep1: DEP := folder1
dep1: check_dep
touch dep1
dep2: DEP := folder2
dep2: check_dep
touch dep2
...
0
votes
1
answer
80
views
Using shared library on GNU/Linux with gcc
Main issue
I am on GNU/Linux outputting C code to a shared library bin/libcore.so and then using the library in the creation of an executable bin/test. The files are successfully created, but bin/test ...
6
votes
1
answer
180
views
GDB: Invalid cast when using strcmp and Logical AND operators
I am working on a c program to add conditional breakpoints or print some values. But when I use some expressions, the gdb failed with Invalid cast.
OS: Ubuntu 24.04.1 LTS
GCC: gcc (Ubuntu 13.3.0-...
2
votes
0
answers
73
views
GNU Parallel does not passing variables if --semaphore specified [closed]
So I have a /tmp/input.txt which have content:
1 1 6
2 3 6
And a job.sh file:
#!/usr/bin/env bash
set -euo pipefail
echo $1
echo $2
echo $3
When I run:
cat /tmp/input.txt | parallel --colsep ' ' ./...
1
vote
1
answer
78
views
GNU parallel, is it possible to force parallel read a file starting from specific line?
I have a command that reads a giant(92GB, 100M+ lines) file in parallel. File grows in time, perhaps, it is a log a file.
Command itself:
parallel -a "2025-03-18.log" -k --pipepart "...
1
vote
0
answers
40
views
How to Properly Stop a GNU screen Session and Ensure All Running Processes Are Killed?
I’m using GNU screen to run a service, but when I stop the session, the processes running inside it are not always terminated properly. This results in ports remaining occupied and prevents the ...
6
votes
1
answer
228
views
Linker created aggregate array
In the c/c++ toolchain available under GreenHills there's a feature which allows the linker to construct a static, in-memory array from initializers in multiple compilation units. This uses specially ...
0
votes
0
answers
56
views
how to copy Variable View columns to clipboard in PSPP
I tried all sorts of stuff, Ctr+C, various syntax exports and others. I am amazed that there is no way to copy the contents, anyone has suggestions?
-3
votes
1
answer
120
views
Wrong week numbers for 2025 in GNU date? [closed]
Why does GNU date display the second week instead of third week for 13th of Jan 2025?
❯ LANG=en cal -w
January 2025
Su Mo Tu We Th Fr Sa
1 1 2 3 4
2 5 6 7 8 9 10 11
3 12 ...
0
votes
1
answer
66
views
Does the `hash` builtin command in Bash has an `-l` option? [closed]
I am teaching myself the shell and enjoying it a lot. I came across the hash builtin the other day in a course and did some study on it. This led me to the bash manual, and namely this section on the ...
0
votes
0
answers
283
views
Problems with building binutils
I am trying to build binutils-2.43. My system is debian linux. I am following section 3.1 of sourceware.org/binutils/binutils-porting-guide.txt it is failing at below command. Please see command and ...
0
votes
0
answers
80
views
Why does = fail to concatenate variables in GNU Make on WSL, but works fine with :=?
Body:
I am experiencing a strange issue with GNU Make on WSL (Windows Subsystem for Linux). When using = for variable assignment, concatenation doesn't work as expected. However, when I switch to :=, ...
0
votes
1
answer
79
views
Failed to use GNU MIPS builtin functions of vector (SIMD)
I am working on an embedded Linux system (kernel-5.10.24) for a MIPS CPU. Now I want to test GNU builtin functions for MIPS SIMD listed in https://gcc.gnu.org/onlinedocs/gcc/MIPS-SIMD-Architecture-...
0
votes
0
answers
51
views
Building `gnu-riscv-toolchain` in a podman container
I'm trying to build the riscv32-unknown-elf-gcc toolchain from https://github.com/riscv-collab/riscv-gnu-toolchain in a container, but the build fails and I have no idea why.
Here is my ContainerFile:
...
0
votes
0
answers
25
views
How to exclude files based on mkid --lang-map=$HOME/.id-lang.map for gnu id creation?
I am using mkid to create a gnu id database. In my source code directory some .c files get generated on compilation. Now I need to ignore the paths of these unwanted generated files, while creating ...
1
vote
1
answer
159
views
constexpr function not compiling post gcc 10
I have the following code snippet :
#include <iostream>
// Another function that takes a const char array reference
template <size_t N>
constexpr
int anotherFunction(const char (&...
1
vote
1
answer
151
views
GLIBC Compile Error: Implicit Declaration of Function
I am trying to compile GLIBC from source however during that process I get the following error:
../sysdeps/ieee754/flt-32/e_gammaf_r.c: In function ‘__ieee754_gammaf_r’:
../sysdeps/ieee754/flt-32/...
0
votes
0
answers
92
views
How do I print to console with printf()? (using GCC in Windows 10) [duplicate]
I am new to assembly code, and would like to try it as a means to add extra functionality C++ and C. I'm still on the Hello World phase of asm use, however, and have been having trouble with the ...
0
votes
1
answer
488
views
Struggling to understand riscv64-unknown-elf-objcopy -O verilog output
I'm using riscv64-unknown-elf-objcopy -O verilog to convert a RISCV elf file. I can see that there is a related option --verilog-data-width which affects the output.
For example, with --verilog-data-...
1
vote
0
answers
135
views
Error Compiling Binutils for i386-elf on macOS: Malformed Archives
I’m trying to cross-compile binutils for i386-elf on macOS (Sequoia 15.0.1, arm64) but encounter an error when running make. Here are the steps I followed:
Installed required dependencies:
brew ...
0
votes
1
answer
63
views
Linux command line utilities: Can sort(1) sort text by multiple (>2) columns? [closed]
I have the following data
foo-a12a11
foo-a12a2
foo-a12b12
foo-a12b21
foo-a13a10
foo-a13a1
foo-a13a9
IIII122344 # this indicates the order in which I want to consider the fields (I=ignore)
I want ...
2
votes
2
answers
191
views
how to find date of nth occurrence of a particular day of the week (e.g. Sunday) in a particular month in gnu date bash
I want to find the date for the third Sunday of the month for a given month using the gnu date command in bash.
I know that one can write this to find the next Sunday from now:
date +%Y%m%d -d "...
2
votes
2
answers
148
views
Makefile help target
I am trying to create a nice and dynamic help, but I am struggling to interpret the variable name in the project's .env file. I need these names to be interpreted by the .env. I will provide the ...
1
vote
0
answers
55
views
GAS assembler: What are the uses of .type? (A set of questions)
When can I use this directive?
Are there any other types besides function, tls_objrct, object, and common?
Are there examples of using each type from the .type?
Can I create my own type and mark it ...
0
votes
0
answers
47
views
Bash command fails when part of it is coming from a variable [duplicate]
There are so many similar questions but nothing I tried seems to apply in this awfully simple case.
This is part of a long script but I'll try to summarise, in a nutshell:
This command works:
ffmpeg -...
1
vote
1
answer
247
views
How do I see the assembler files in CMake?
I am using CMake to compile fortran code with the GFortran compiler. I want to see the assembler files but I haven't done this before. Should I see .s files after running make?
I've enabled assembly ...
0
votes
0
answers
90
views
Segmentation fault (core dumped) in GNU Assembly x86
I am writing power function in GNU Assembly x86 on Linux principal-neanderthal 6.8.0-41-generic x86_x64. When i launch i get "segmetantion fault (core dumped)" error.
.code32
.section .data
...
0
votes
1
answer
117
views
Finit loop doesn't finishes or show segfault
I used GNU BC ( basic calculator ) for exponentiation 999,999 to 999,999 and it answered in 10 minutes but when I want to find 999,999 root of a big file ( 1.1 GB) it shows segfault after 5 hours and ...
1
vote
0
answers
24
views
gnu ld linker script LONG() not placing value as expected (ARM Cortex-M3) [duplicate]
gnu .ld linker script --
I have added a MEMORY definition to hold a checksum:
_CRC_Value = 0x12345678;
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 80K
FLASH (rx) : ORIGIN = ...
1
vote
2
answers
89
views
How to extract columns from CSV file, process and create a CSV file based on the extract and processing result?
The is a snipped from the source CSV file.
%status,date,job,project,start,end,description
%
//,18.03.2021,sib,sib-dede,07:00,15:00,dede-mongo
%
//,11.06.2021,sib,sib-dede,07:00,15:00,dede-mongo
%
//,...
4
votes
2
answers
92
views
sed regexp strangeness
trying to replace a string in sed with embedded { and $ and with -E or -r, the { is problematic for me.
according to the docs and many examples I have read, I should only have to escape the { and $ if ...
1
vote
1
answer
280
views
Can I suppress a specific linker warning about a specific location?
My project code links against some libraries whose source I don't have. During linking I get:
/usr/x86_64-suse-linux/bin/ld:libfoo.a(foo.o): in function `flush':
source/readcfg.c:1234:(.text+0xabc): ...
-3
votes
3
answers
330
views
How to fix "fatal error: ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp: No such file or directory"
I want to use ordered_set in C++, for that I copied the header files from here.
The header files are:
include <ext/pb_ds/assoc_container.hpp>
include <ext/pb_ds/tree_policy.hpp>
When I ...
-1
votes
1
answer
111
views
Is it declaratively impossible to get the returncode from a screen command over ssh?
I am writing a python program that needs to trigger long running programs through ssh, and I've decided on using screen.
I need to know the result of the program at some later point, so, following the ...
0
votes
1
answer
65
views
make file failing with No such file or directory
I'm running makefile in Githubactions. My makefile is failing to run touch command. I'm not sure what is the error here.
Tried adding : `$(shell) to make command, still the same error. It worked in ...
0
votes
1
answer
83
views
VSCode Linker can not find ARM GNU Commands to write/read
Hi Guys sorry but this is my first time trying to setup ARM GNU On my Mac-OS Apple Sillicon M1. I am having trouble with it as the linker fails to find the commands listed in the screenshot
So far i ...
0
votes
0
answers
235
views
Evil-mode doesn't work on Emacs 29.1 (Windows)
I recently installed emacs 29.1 on my Windows machine from this repo:
https://ftp.gnu.org/gnu/emacs/windows/emacs-29/
I started configuring it and the first thing I did is install evil-mode, so I can ...