glibc

How do I link glibc's implementation of iconv?

本小妞迷上赌 提交于 2019-12-03 08:42:06
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 exist! $ nm -D /lib/libc-2.12.1.so | grep iconv 00017920 T iconv 00017ae0 T iconv_close 00017720 T

glibc detected, realloc(): invalid pointer

こ雲淡風輕ζ 提交于 2019-12-03 08:26:07
I apologize for the lengthy code. I have a simple question, but I thought I include my code so it will be clear where I am coming from. I get a realloc corruption. I think the corruption is because I am not freeing correctly. In reality I am not sure what glibc even says or means. Can any one briefly explain that to me? Again sorry for the lengthy code. #include "draw2.h" #include "draw2a.h" #include "draw2b.h" const char Exec_c[] = "java -jar Sketchpad.jar"; void parseFile(FILE * fp, FILE *sketcher){ char line [MAX_WORD] = {"NULL"}; char word [MAX_WORD] = {"NULL"}; char figureName [MAX_WORD]

CentOS 7.2+Python 3.7+cuda 10.0+cuDNN 7.6+tensorflow 1.13.1踩坑填坑记

无人久伴 提交于 2019-12-03 08:24:01
CentOS安装tensorflow-gpu的过程遍地是坑,有条件的哥们还是遵从Tensorflow官方建议,直接上Ubuntu。 如下主要包含了几个分支: 安装Python 3 显卡驱动 CUDA/cuDNN tensorflow-gpu glibc和gcc CentOS 7.2安装Python 3.7 CentOS 7.2默认的Python版本是2.7.5,这里采用源码编译安装Python 3.7。 $ ll /usr/bin/ | grep python -rwxr-xr-x 1 root root 11312 Nov 14 2018 abrt-action-analyze-python -rwxr-xr-x 1 root root 7280 Nov 3 2018 pmpython lrwxrwxrwx 1 root root 7 May 24 12:39 python -> python2 lrwxrwxrwx 1 root root 9 May 24 12:39 python2 -> python2.7 -rwxr-xr-x 1 root root 7216 Oct 31 2018 python2.7 $ python Python 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4

What size should I allow for strerror_r?

≡放荡痞女 提交于 2019-12-03 08:12:51
问题 The OpenGroup POSIX.1-2001 defines strerror_r, as does The Linux Standard Base Core Specification 3.1. But I can find no reference to the maximum size that could be reasonably expected for an error message. I expected some define somewhere that I could put in my code but there is none that I can find. The code must be thread safe. Which is why strerror_r is used and not strerror. Does any one know the symbol I can use? I should I create my own? Example int result = gethostname(p_buffy, size

How to use getaddrinfo_a to do async resolve with glibc

拜拜、爱过 提交于 2019-12-03 07:09:52
问题 An often overlooked function that requires no external library, but basically has no documentation whatsoever. 回答1: UPDATE (2010-10-11) : The linux man-pages now have documentation of the getaddrinfo_a, you can find it here: http://www.kernel.org/doc/man-pages/online/pages/man3/getaddrinfo_a.3.html As a disclaimer I should add that I'm quite new to C but not exactly a newbie, so there might be bugs, or bad coding practices, please do correct me (and my grammar sucks too). I personally didn't

What is __i686.get_pc_thunk.bx? Why do we need this call?

别说谁变了你拦得住时间么 提交于 2019-12-03 06:20:39
问题 When I disassemble my small function, I happened to see this call call 0xf60d2f47 <__i686.get_pc_thunk.bx>. I have no clue why I need this call in my program. Any explanation would be helpful. 回答1: This call is used in position-independent code on x86. It loads the position of the code into the %ebx register, which allows global objects (which have a fixed offset from the code) to be accessed as an offset from that register. Position-independent code is code that can be loaded and executed,

set global gcc default search paths

萝らか妹 提交于 2019-12-03 06:04:54
问题 when running arm-none-linux-gnueabi-gcc -print-search-dirs | grep libraries | sed 's/:/\n/g' I get the following output: libraries =/opt/codesourcery/lib/gcc/arm-none-linux-gnueabi/4.4.1/ /opt/codesourcery/lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/lib/arm-none-linux-gnueabi/4.4.1/ /opt/codesourcery/lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/lib/ /opt/codesourcery/arm-none-linux-gnueabi/libc/lib/arm-none-linux-gnueabi/4.4.1/ /opt

GLIBCXX_3.4.9 not found

久未见 提交于 2019-12-03 04:42:48
问题 I have a problem concerning libstdc++.so . I installed a new version of gcc and tried to compile C++ code. The compiling worked, but when I try to execute the binary ( m5.opt is its name) I've got the following error: build/ALPHA_SE/m5.opt: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by build/ALPHA_SE/m5.opt). Do I need to replace libstdc++.so ? And if so, where can I download the version I want? On the GCC-website they say libstdc++ is a part of gcc now. Details

CentOS7安装mysql5.6-二进制包安装方法

你离开我真会死。 提交于 2019-12-03 03:59:40
一:卸载系统自带的Mariadb 1:查询是否已安装mariadb -->rpm -qa|grep mariadb 2:卸载mariadb,文件名为上一步查询出来的结果文件 -->rpm -e --nodeps 文件名 3:删除etc目录下的my.cnf -->rm -rf /etc/my.cnf 二:下载mysql安装包 1:下载安装包mysql-5.6.34-linux-glibc2.5-x86_64.tar(可前往官网自行下载:http://dev.mysql.com/downloads/mysql/) 2:解压 -->tar -zxvf mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz !备注:工作学习软件安装在/usr/app下 3:重命名解压后的软件文件夹名称 -->mv mysql-5.6.34-linux-glibc2.5-x86_64 mysql 三:为数据库单独建用户组和用户 -->groupadd mysql -->useradd -g mysql mysql -->passwd mysql 四:配置my.cnf 1:copy一份my.cnf文件放到/etc/下 --> cp /usr/app/mysql/support-files/my-default.cnf /etc/my.cnf 2:配置 -->vim /etc/my

Is there a best practice on setting up glibc on docker alpine linux base image?

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there a best practice on setting up glibc on docker alpine linux base image with correct paths so any spawned process can correctly reference the location of the installed libc libraries? 回答1: Yes there is, I've used a custom built glibc to install a JRE on it. You can find it here You can use wget or curl to get the code and apk to install them apk --no-cache add ca-certificates wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub wget https://github.com/sgerrand