Questions tagged [gnu]
This tag is for programming questions related to software and tools provided by the GNU ("GNU's Not Unix") project.
2,831
questions
0
votes
0
answers
15
views
Remanent prompt staying in a readline history when using rl_add_history
I am currently recreating a mini version of bash in C. I am having troubles with the readline function: when I type a pipe command such as cat /etc/os-release | grep ubuntu I have some characters that ...
-2
votes
0
answers
11
views
Does adding GPL v2.0 licensed code to my MIT-licensed repository require changing the overall project license to GPL v2.0?
In the development of my open source project, which is currently MIT licensed, I am considering accepting a contribution which is a few lines of code. The code that is being contributed is licensed ...
-1
votes
0
answers
44
views
Adalm Pluto SDR - Second RX channel signal issues
I have a Pluto SDR rev c, on which I just enable the second TX and RX channel.
I am sending a simple sinusoidal signal at a specific frequency (fc), but different phase and amplitude, using the two tx ...
0
votes
2
answers
42
views
Makefile with runtime dependencies
Suppose I have some makefile with a rule for generating sources (simplified example)
SRCS = $(shell find src -name "*.c")
OBJS = $(patsubst src/%.c, build/%.o, $(SRCS))
generate-src:
@...
-1
votes
0
answers
29
views
When I hit the run button on Codelite this page appeared what i have to do ? I have a GNU gdb debugger , is it a problem? And there is no library?
¨make[1]: *** [Debug/ProjectC2] Error 1
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
/usr/bin/g++ -o Debug/ProjectC2 @"...
0
votes
1
answer
30
views
How to use a local version of openMP? (GOMP)
I'd like to bring up some changes (just some prints momentarily) to the GOMP library that I've downloaded from the git repo but seems like what I'm doing is not really effective because there's no ...
0
votes
0
answers
16
views
How can I find build information of a particular guix store item
After messing around with the GNU Guix system for a while, I end up with several "guile-3.0.9/" directory in my /gnu/store/
ls -p /gnu/store | grep 'guile-3.0.9/'
...
1
vote
1
answer
75
views
How I can have a better understanding of the workflow for some directive in GCC? [closed]
I'm currently working on a project and I need a better understanding of the GCC workflow of a GOMP directive and I'd like to bring up some changes to the source code too.
Is there a best practice to ...
0
votes
1
answer
25
views
Bulding only GCC backend without building other components
I would like to build GCC backend with minimum dependencies without building other components, can I get the steps for the same please.
I am trying to build gcc backend but in order to build entire ...
-2
votes
2
answers
69
views
Generate all dates between two dates in %Y-%m-%d-%H format in bash
Using bash I want to generate all dates between, say, 2023-11-04-00 and 2023-11-06-00 where the format is %Y-%m-%d-%H. I have tried :
#!/bin/bash
d=2023-11-04
while [ "$d" != 2023-11-06 ]; ...
1
vote
1
answer
49
views
how can I define a memory area to use both in my linker script and c code at compile time?
I have the following in my linker script:
...
_other_start = ORIGIN(OTHER);
_other_end = ORIGIN(OTHER) + LENGTH(OTHER);
_other_size = LENGTH(OTHER);
...
/* Memories definition */
MEMORY
{
...
1
vote
1
answer
66
views
Make a speaker vibrate at a defined frequency in Ubuntu Linux, with GNU Assembly
I am new to assembly language
Our computer makes sound all the time (mp3, wav, mp4, ogg, etc).
How could I directly communicate to a speaker with assembly language? In C, you can use "Beep()"...
6
votes
8
answers
175
views
Bash: Extract multiple entries from each line
I have a log file that looks somewhat like this after grep my_function $LOG_FILE:
[0] my_function took 96.78581194020808 ms
[1] my_function took 82.0779490750283 ms
[2] my_function took 187....
0
votes
0
answers
86
views
How to debug Node.js child process EBADF errors
I have a Node.js development environment process manager that consistently after ~20 minutes of work starts throwing a spawn EBADF error (see truncated stack below) every time I try to spawn a new ...
0
votes
0
answers
116
views
collect2: error: ld returned 1 exit status; ld error; gcc
my code:
#include <iostream>
#include <random>
int main(){
std::default_random_engine generator;
std::uniform_int_distribution dice_roll(1,6);
std::cout << dice_roll(...
1
vote
2
answers
85
views
GNU Parallel - command not found
I'm trying to use GNU parallel together with SLURM to run several instances of the same script with different input parameters. For that, I allocate 3 nodes via SLURM and then I create several threads ...
1
vote
0
answers
40
views
How can I change debug info path of binaries
I'm still learning to use the terminal to build projects. I want to change the debug information path from one to another.
For example, I have a project structure as following:
├───build
│ ├───obj
│ ...
0
votes
1
answer
38
views
Not work when use -I(capital i) in gcc in makefile
I am writing a Makefile to run my c program.
The directory and files are shown below,
And here is my codes in Makefile
all: perimeter.o main.c
gcc -o program main.c perimeter.o
perimeter.o: ...
0
votes
0
answers
63
views
atomic operation with glibc C different from _Atomic [duplicate]
According to this link,
[we] can assume that int is atomic. You can also assume that pointer types are atomic...Both of these assumptions are true on all of the machines that the GNU C Library ...
0
votes
0
answers
9
views
How to have "find ... -exec ..." return execution errors?
I would like to traverse a directory tree with GNU find and execute a command via -exec option.
I would like to have find failing with non-zero return code as soon as the executed program returns non-...
0
votes
0
answers
24
views
Filling unused space between sections with GNU LD
I'm linking some code for 8088 CPU (loaded at 0xF0000..0xFFFFF) with the following LD script:
SECTIONS
{
.code 0x0000 : AT(0xF0000) {
*(.rodata);
*(.text);
}
.reset 0xFFF0 :...
0
votes
1
answer
22
views
GNU bash dump-po-strings option
in GNU bash manual reference (section 6.1 : Invoking bash) there are some option, two of them are as follows:
--dump-po-strings A list of all double-quoted strings preceded by ‘$’ is printed on the ...
1
vote
1
answer
40
views
How to use ".ifnb" in Gnu Assembly? And how to accept a blank value as an argument for a ".macro" function in GAS?
I am trying to pass a blank value to a macro funtion in GNU Assembly on x64, this function is supposed to add three value togather or just two according to if the first argument is blank, e.g.,
.macro ...
0
votes
1
answer
26
views
GNU autotools: cmake gui to configure conversion
So I have this cmake gui:
I can only partially translate that in to following cmd:
configure --prefix=/opt/systemc --enable-pthreads
How should I set CMAKE_BUILD_TYPE and CMAKE_CXX_STANDARD?
1
vote
0
answers
60
views
How can I set an "end of code" marker at the end of my binary?
I have a GNU linker script for my firmware with the following section defined:
.endc :
{
KEEP(*(.endc));
. = ALIGN(4);
_end_code_mark = .;
} >FLASH
This is the last time I'm ...
0
votes
0
answers
40
views
Workaround to linker script "INSERT BEFORE" with GNU gold
I have a linker script that currently works with GNU ld.
I wanted to link using GNU gold but I am hitting an issue because currently GOLD does not support "INSERT BEFORE" in linker scripts, ...
0
votes
0
answers
14
views
GNU Binutils ld Final Link Error: file truncated
trying to manually link some object file archives (.a) files, no obvious warnings besides overlay symbols not being in segment (this compiled in a different configuration so I wasn't concerned), now ...
0
votes
0
answers
26
views
LibreOffice basic get all checkboxes
I'm currently working on a project that involves migrating VBA macros to LibreOffice Basic macros. However, I've encountered a challenge with one particular macro where I need to iterate over all ...
1
vote
2
answers
50
views
Roots of simultaneous equation in OCTAVE
How can I solve:
y1 = -x1 + 2*x1^3 + x2
y2 = -x1 - x2 at y1 = 0, y2 = 0
I tried this
function y = f(x)
y(1) = -x(1) + 2*x(1)^3 + x(2);
y(2) = -x(1) - x(2);
endfunction
fsolve("f&...
0
votes
0
answers
28
views
making gcc-10.5.0 while it is paused
I tried to install gcc-10.5.0 from source (without using sudo) based on the information provided in here:
https://gcc.gnu.org/wiki/InstallingGCC
However, after a while, it pauses without any error at ...
1
vote
1
answer
31
views
GNU parallel is not starting every sequence i give him to
I'm trying to use GNU parallel to start background jobs in parallel like this:
parallel --tag -j1000% ./cplusplus {} ::: $(seq 9001 9011)
Using --tag shows me what is being done, sometimes one job ...
0
votes
0
answers
72
views
How is my Hello World assembly code not working?
Here is my code:
section .bss
; variables
section .data:
; constants
hello: db "Hi Mom!"
helloLen: equ $-hello
section .text
global _start
_start:
mov rax,...
0
votes
0
answers
71
views
gnu g++-13 can't find wchar.h in mac OS, but xcode tools is installed?
In file included from /usr/local/Cellar/gcc/13.2.0/include/c++/13/bits/postypes.h:40,
from /usr/local/Cellar/gcc/13.2.0/include/c++/13/iosfwd:42,
from /usr/local/...
1
vote
2
answers
192
views
GNU Arm Toolchain - Minimum Installation
I am trying to generate a binary from source for a cortex m0 and using the GNU ARM Embedded Toolchain for that along with a simple makefile.
It is possible for me to use just arm-none-eabi-gcc to ...
1
vote
1
answer
87
views
(GNU+Linux) Multiple threads calling malloc() at the same time
I read online that most moden UNIX systems come with a thread-safe malloc() by default. I know this simply means that a thread can call malloc() safely while another thread is already in the middle of ...
1
vote
0
answers
33
views
What is the difference between LEAQ and MOVABSQ in x86_64? [duplicate]
I'm writing a basic hello world program in x86_64 GNU Assembly on Windows. Since I could not find a working example for Windows, I've been following a tutorial for Linux, replacing the syscalls with ...
0
votes
0
answers
21
views
Where is the official documentation of gnu linker script command language?
Search engine results for gnu linker script command language return pretty old (pre 1998) documentation. So where can one find the documentation for gnu ld's script command language?
What did I try? ...
0
votes
1
answer
32
views
Why does GNU ld linker doesn't remember all the symbols it sees
When linking with GNU ld, the order is important. The dependent library must appear before the dependency.
For instance, if a function in file1.a calls a function in file2.a, then the linking order ...
0
votes
1
answer
63
views
Custom printf function segmentation fault
can anyone help with this project task?
I am to build a custom printf funcion after my C classes.
I'm restricted to use most standard C functions.
Must follow Aunty Betty coding style and below is the ...
0
votes
0
answers
29
views
Failed to run gcc when trying to run a zmq4 example in Go
i got this error C:\Program Files\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
trying to run the hwserver.go example from https://github.com/pebbe/zmq4/blob/master/examples/...
-1
votes
1
answer
170
views
How to correctly exclude hidden files and directories in linux `grep` result?
I'm trying to exclude hidden files and directories in grep command.
I found some answers here but they're not working:
grep -r --color=always -n -H --exclude-dir='.*' -- 'something'
The reason is ...
-1
votes
1
answer
99
views
Using Sed to capitalize the first letter of the first word in the sentences (each sentence starts with a double hyphen, -- )
I would like to try to use the Sed command to capitalize the first letter of the first word in the sentences, in a text where all the sentences begin with a double hyphen and one space.
For example, I ...
0
votes
0
answers
73
views
Weak function gets executed when its file is linked first
I have 2 files:
strong.cc
#include <stdio.h>
void foo(){
printf("Strong is here\n");
}
weak.cc
#include <stdio.h>
void __attribute__((weak)) foo();
void foo(){
printf(&...
-1
votes
1
answer
84
views
Curve Fitting with GNU Scientific Library
I am trying to fit a curve to a set of points with GSL. I am not very experienced with GSL and took help from chatGPT for the same. But the code isnt compiling, and after a while i felt like was ...
0
votes
2
answers
120
views
CMake - Dynamically determine CPU Architecture
I am working on a CMake build script that requires the ARM embedded toolchain. Depending on the user's OS and CPU architecture, a different version of the toolkit needs to be downloaded. This is fine ...
0
votes
1
answer
34
views
Locating the File Responsible for Reading and Interpreting Command Line Elements in the Bash Shell
I have a question regarding the Bash shell. I'm currently
working on an exercise that involves building a basic shell. I understand that
properly reading and interpreting each element of the command ...
1
vote
1
answer
125
views
STM32 CubeIDE Place a static library in specified memory region and mapped to the absolute memory address
I have an STM32 CubeIDE project.
I want to place a static library in an absolute memory address in the upper part of the internal flash while the application code will be placed at the beginning of ...
0
votes
0
answers
52
views
Some of the ASan option of LLVM Clang is not available while targeting risc-v
I'm observing the exact execution of the Address Sanitizer supported by LLVM. To do so, I was compiling some test codes with the option argument -fsanitize, just like -fsanitize=address, -fsanitize=...
0
votes
2
answers
86
views
Why don’t make check the timestamp when the dependency file is not generated?
I create an ugly Makefile, it worked beyond my expectations. When main.o is not built successfully, the executable is built every time I make. In my opinion, after the main.o target command is ...
0
votes
0
answers
57
views
GNU gprof showing calls in seconds instead of milliseconds
Is there an option i am missing that i couldnt find? i have searched the internets and all the articles show the flat profile in milliseconds without any added option tags, but my gprof outputs the ...