glibc

major and minor macros defined in sys/sysmacros.h pulled in by <iterator>

℡╲_俬逩灬. 提交于 2019-12-04 17:13:48
问题 I'm writing a class that has a matrix-like structure and I want to have a member function named minor to be the same as the matrix operation. This triggers some errors. A minimal test case on my system: #include <iterator> void minor(int row, int col); When compiled, clang provides the following error: $ clang++ -Weverything -std=c++11 test.cpp test.cpp:2:21: error: too many arguments provided to function-like macro invocation void minor(int row, int col); ^ /usr/include/x86_64-linux-gnu/sys

Accessing .eh_frame data during execution

徘徊边缘 提交于 2019-12-04 15:26:26
This question was migrated from Unix & Linux Stack Exchange because it can be answered on Stack Overflow. Migrated 6 years ago . I'm trying to access the contents of .eh_frame section of a running program from within it (specifically, the program is Linux kernel 2.6.34.8). The .eh_frame contains useful data used for exception handling and I'd like to use it internally from within kernel code. The section is already being written by gcc ( readelf -a vmlinux.o contains .eh_frame ), the problem is reading it from the code. I'm pretty sure the elf format docs say that .eh_frame is accessible

Why does backtrace not contain Objective-C symbols regardless of -rdynamic?

天大地大妈咪最大 提交于 2019-12-04 14:20:08
Update: I'm working with the GNU-runtime on Linux. The problem does not occur on MacOS with the Apple-runtime. Update 2: I compiled the GNU-runtime on MacOS and build the example with it. The error does not occur on MacOS with the GNU-runtime. I would say the problem is the glibc (since backtrace and backtrace_symbols are glibc extensions). When printing a backtrace in a GCC compiled Objective-C app using backtrace and backtrace_symbols , I don't get any Objective-C symbols. Only the filenames, addresses and C-symbols appear. I compiled with -g and linked with -rdynamic . My test app: void

How do I link glibc's implementation of iconv?

六眼飞鱼酱① 提交于 2019-12-04 13:32:44
问题 The GNU C library provides an implementation of iconv - how do I use it? Simple program: #include <iconv.h> int main( int argc, char **argv ) { iconv_t cd = iconv_open( "UTF-8", "ISO-8859-1" ); iconv_close( cd ); return 0; } Compile and link: $ gcc -Wall iconv.c -o iconv /tmp/ccKAfXNg.o: In function `main': iconv.c:(.text+0x19): undefined reference to `libiconv_open' iconv.c:(.text+0x29): undefined reference to `libiconv_close' collect2: ld returned 1 exit status List the symbols to show they

在Android模拟器中安装busybox

时间秒杀一切 提交于 2019-12-04 12:47:25
在 Android 模拟器中安装 busybox 【背景】: Android 模拟器的 shell 真是难用啊,很多命令都不支持,如 find 、 grep 、 send 等等,最近正好有时间,想捣鼓捣鼓,用交叉编译将 busybox 安装到模拟器中去。 【具体步骤】: 1) 下载 busybox 源代码,并解包 $ wget -c http://www.busybox.net/downloads/busybox-1.7.0.tar.bz2 $ tar jxvf busybox-1.7.0.tar.bz2 2) 下载交叉编译工具,并安装 我下载的是: arm-2009q1-161-arm-none-eabi.bin 说明:要正确设置好 PATH 变量。 例如将 “ 你的目录 ”/CodeSourcery/Sourcery_G++_Lite/bin 加到 PATH 路径中。 3 )进入到 busybox 解压后的源文件目录中,修改 Makefile 将第 176 行改为: CROSS_COMPILE ?=arm-none- Linux -gnueabi- 4 )进行编译选项配置 a 、 $ make menuconfig Busybox Settings ---> Build Options ---> [*] Build BusyBox as a static binary(no

glibc not supported by Cygwin

送分小仙女□ 提交于 2019-12-04 11:35:01
Cygwin FAQ has the following info for 'Where is glibc?' : Cygwin does not provide glibc. It uses newlib instead, which provides much (but not all) of the same functionality. Porting glibc to Cygwin would be difficult. I was surprised and checked out the release packages as i had earlier used it. While i checked the repositories, it appears that glibc was actually indeed part of cygwin until version 2.10. Can anyone tell of the porting difficulty for the subsequent versions of glibc ? The Cygwin FAQ is correct, of course; glibc has never been part of Cygwin. The C library on Cygwin is cygwin1

GLIBCXX not found when compiling vtk example under mex

南楼画角 提交于 2019-12-04 10:54:24
I have been trying to follow this example for compiling vtk in MATLAB using mex, on an Ubuntu 11.10. The mex command I used is as follows: mex -I/usr/include/vtk-5.6 vtk_file.cpp -L/usr/lib/ -lvtkFiltering -lvtkRendering -lvtkCommon After compilation I have a .mexa64 file. However, when I try to run the file I end up with the following error: Invalid MEX-file '/home/bill/Documents/MATLAB/vtk/vtk_file.mexa64': /usr/local/MATLAB/R2011b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /usr/lib/libvtkFiltering.so.5.6) How can I ensure that glibcxx is

Is the GNU C Library usable on non-GNU (or POSIX) platforms?

孤街醉人 提交于 2019-12-04 10:50:49
Just wondering, is the GNU C Library (glibc) usable on non-GNU and/or non-POSIX platforms such as Microsoft Windows? Yes, its possible in theory, but not really worth it in practice. You would need to port the syscall interface, dynamic linker, and other parts to Windows or your platform of choice, and Glibc is not an ideal candidate for this. If you really need a self contained C library, I would consider newlib or uClibc (or FreeBSD's/OpenBSD's libc) over glibc. Glibc is a complex beast, the alternatives are much smaller and easier to understand. It is provided that glibc has been ported to

Non-blocking read on pipe

和自甴很熟 提交于 2019-12-04 09:10:11
Can one do non-blocking I/O on a pipe? fcntl fails to set O_NONBLOCK. Page 918 of The Linux Programming Interface includes a table 'Semantics of reading n bytes from pipe or FIFO (p)'. This table lists the behaviour of pipes and FIFO's with one column titled O_NONBLOCK enabled? This would imply that you can set the O_NONBLOCK flag on a pipe. Is this correct? The following code fails to set the flag, fcntl(2) does not report an error though. #include <fcntl.h> #include <sys/wait.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> #define SLEEP 1 int main(int argc, char *argv[]) { pid

Can I use glibc under windows?

安稳与你 提交于 2019-12-04 09:07:56
Is it (or would it) be possible to use glibc under windows (as a replacement of msvcrt)? I know this is a stupid question, and answers like cygwin will pop up, but I am really asking: is it possible to link to glibc on windows and use all library functions like with msvcrt? A possible workaround could exist: if someone combines http://0xef.wordpress.com/2012/11/17/emulate-linux-system-calls-on-windows/ with http://www.musl-libc.org/ and compiles source code with gcc against musl libc instead of glibc. So, I can't understand why nobody writes a such glibc analog for Windows. :-( glibc used to