glibc

Purpose of __USE_XOPEN2K8 and how to set it?

好久不见. 提交于 2019-12-10 17:33:50
问题 I'm trying to compile the gtk stack (the last gtk2 version, 2.24), and I am getting a bunch of errors that seem related. Namely, the __locale_t can't be found from string.h and time.h, and LC_ALL_MASK can't be found either (should be in locale.h). I found that all of these problems are related to __USE_XOPEN2K8 not being #defined. What is __USE_XOPEN2K8 for, and how can I set it propertly? For example, do I have to pass a flag to ./configure for glib, gtk, ... or do I have to change something

How do I fix a “version `GLIBC_2.14' not found” error?

大城市里の小女人 提交于 2019-12-10 16:44:12
问题 I've compiled a C program under Ubuntu 12.04, built a Debian package out of it, and want to install it on a server running Debian Lenny. Last time I did that (about two months ago) it worked: I could install the package and run the binary. But now I get the following error message: (binary's name): /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by (binary's name)) Other than upgrading my machine to Ubuntu 12.4, the only significant change we've brought to the code

Hint to compiler that it can use aligned memcpy

主宰稳场 提交于 2019-12-10 16:17:39
问题 I have a struct consisting of seven __m256 values, which is stored 32-byte aligned in memory. typedef struct { __m256 xl,xh; __m256 yl,yh; __m256 zl,zh; __m256i co; } bloxset8_t; I achieve the 32-byte alignment by using the posix_memalign() function for dynamically allocated data, or using the (aligned(32)) attribute for statically allocated data. The alignment is fine, but when I use two pointers to such a struct, and pass them as destination and source for memcpy() then the compiler decides

What is the purpose of glibc's atomic_forced_read function?

帅比萌擦擦* 提交于 2019-12-10 15:59:10
问题 I am trying to understand the purpose of the definition of atomic_forced_read which shows up frequently in the GNU libc implementation of malloc.c. I am not great when it comes to inline assembly, but it looks like this returns the exact same value, with the same type as the input value. what am I missing here? Atomic forced read definition in atomic.h 523 #ifndef atomic_forced_read 524 # define atomic_forced_read(x) \ 525 ({ __typeof (x) __x; __asm ("" : "=r" (__x) : "0" (x)); __x; }) 526

When will the safe string functions of C11 be part of glibc? [closed]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 15:56:17
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . The C11 standard Annex K defines a bunch of new safer string functions, all suffixed by _s (e.g. strcpy_s ). Do you know when these new functions will become available in the GNU C library glibc? So far you have to fall back to a third party library like safec. 回答1: Do you

GLibc optimizations required

大憨熊 提交于 2019-12-10 15:26:31
问题 Why is it not possible recompile GLibc turning off all the optimizations (i.e., -O0)? Particularly in doing this: make CFLAGS='-O0 -w' CXXFLAGS='-O0 -w' I get: #error "glibc cannot be compiled without optimization" 回答1: When I Google the error, the first result tells me exactly why. "In the early startup of the dynamic loader ( _dl_start ), before relocation of the PLT, you cannot make function calls. You must inline the functions you will use during early startup, or call compiler builtins (

error while using make to compile Glibc-2.11.1 for Linux From Scratch

↘锁芯ラ 提交于 2019-12-10 12:48:06
问题 I am building LFS and I am in the part where we need to install Glibc-2.11.1 http://www.linuxfromscratch.org/lfs/view/6.6/chapter05/glibc.html I have successfully configured it but I cant run the make command. Whenever I run the command it runs for a while then stops. I think the following lines show that something I did is incorrect: mawk: scripts/gen-sorted.awk: line 19: regular expression compile failed (bad class -- [], [^] or [) /[^ mawk: scripts/gen-sorted.awk: line 19: syntax error at

Why doesn't time() from time.h have a syscall to sys_time?

不羁的心 提交于 2019-12-10 12:45:07
问题 I wrote a very simple program with calls time() to illustrate the use of strace , but I'm having a problem; the time() call doesn't seem to actually produce a syscall! I ended up stepping into the time() function in GDB and now I'm more confused than ever. From the disassembly of the time() function: 0x7ffff7ffad90 <time>: push rbp 0x7ffff7ffad91 <time+1>: test rdi,rdi 0x7ffff7ffad94 <time+4>: mov rax,QWORD PTR [rip+0xffffffffffffd30d] # 0x7ffff7ff80a8 0x7ffff7ffad9b <time+11>: mov rbp,rsp

Problems on injecting into printf using LD_PRELOAD method

廉价感情. 提交于 2019-12-10 11:31:08
问题 I was hacking printf() of glibc in one of my project and encountered some problem. Could you please give some clues? And one of my concern is why the same solution for malloc/free works perfect! As attached, “PrintfHank.c” contains my own solution of printf() which will be preloaded before standard library; and “main.c” just outputs a sentence using printf(). After editing two files, I issued following commands: compile main.c gcc –Wall –o main main.c create my own library gcc –Wall –fPIC

Is maths library included in the glibc now?

和自甴很熟 提交于 2019-12-10 11:17:29
问题 when I try to compile this simple code from terminal: #include<stdio.h> int main(void) { printf("%f\n",sqrt(10)); return 0; } using gcc main.c command, it gets compiled and a.out gives correct answer. It means that that maths functions are added in C standard library which gets linked automatically. But if compile the same code in Eclipse IDE without adding any library to properties, it gives undefined reference error. It means maths functions are not part of C standard library. What is the