glibc

“undefined reference to symbol” error when using `ld` to link

烈酒焚心 提交于 2021-02-04 18:48:49
问题 I am new to writing programs on Linux. I have a single module program that uses shm_open , ftruncate , mmap , fork , and wait . I compiled this program with gcc -c and then linked it with ld -lrt (librt is needed for shm_open ) and I got a strange linker error: undefined reference to symbol 'waitpid@@GLIBC_2.2.5' The manpage for wait says Feature Test Macro Requirements for glibc (see feature_test_macros(7)): waitid(): Since glibc 2.26: _XOPEN_SOURCE >= 500 || _POSIX_C_SOURCE >= 200809L Glibc

CentOS系统安装mysql数据库

别来无恙 提交于 2021-02-04 10:48:05
CentOS系统安装mysql数据库 一、 下载mysql5.7 http://mirrors.sohu.com/mysql/MySQL-5.7/ Linux下载: 输入命令: wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz 二、 建立用户,以及mysql的目录 1、 建立一个mysql的组 输入命令: groupadd mysql 2、 建立mysql用户,并放到mysql组 输入命令: useradd -r -g mysql mysql 3、 给mysql用户设置密码 输入命令: passwd mysql 三、 解压mysql 1、 把下载的mysql的包移动到Linux虚拟机下 2、 把tar包复制一份到/usr/local 目录下 输入命令: mv /software/mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz /usr/local 3、 解压 输入命令: cd /usr/local 输入命令: tar xzvf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz 4、 把解压出来的文件改下名字,改为mysql 输入命令: mv mysql-5.7.17-linux-glibc2

【整理】uclibc,eglibc,glibc之间的区别和联系

筅森魡賤 提交于 2021-02-03 07:09:42
【glibc,uclibc,eglibc的简介】 1.Glibc glibc = GNU C Library 是GNU项(GNU Project)目,所实现的 C语言标准库(C standard library)。 目前,常见的桌面和服务器中的GNU/Linux类的系统中,都是用的这套C语言标准库。 其实现了常见的C库的函数,支持很多种系统平台,功能很全,但是也相对比较臃肿和庞大。 2.uClibc 一个小型的C语言标准库,主要用于嵌入式。 其最开始设计用于uClinux(注:uClinux不支持MMU),因此比较适用于微处理器中。 对应的,此处的u意思是μ,Micro,微小的意思。 uClibc的特点: (1)uClibc比glibc要小很多。 (2)uClibc是独立的,为了应用于嵌入式系统中,完全重新实现出来的。和glibc在源码结构和二进制上,都不兼容。 3.EGLIBC EGLIBC = Embedded GLIBC EGLIBC是,(后来)glibc的原创作组织FSF所(新)推出的,glibc的一种变体,目的在于将glibc用于嵌入式系统。 EGLIBC的目标是: (1)保持源码和二进制级别的兼容于Glibc 源代码架构和ABI层面兼容 如果真正实现了这个目标,那意味着,你之前用glibc编译的程序,可以直接用eglibc替换,而不需要重新编译。

mysql 5.7.25 安装部署

ⅰ亾dé卋堺 提交于 2021-02-02 15:43:57
mysql 5.7.25 安装简介 1 卸载linux系统上自带的mysql插件(old版本) rpm -qa|grep -i mysql rpm –ev {包名} --nodeps 2 删除老版本mysql相关的安装目录命令 find / -name mysql rm –rf {目录名} 3 安装包下载 官网下载 mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz 编译过的安装包 tar -xzvf mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz mv mysql-5.7.25-linux-glibc2.12-x86_64 /usr/local/mysql 4 主目录权限处理 查看组和用户情况 cat /etc/group | grep mysql cat /etc/passwd |grep mysql 删除原mysql用户:userdel -r mysql,会删除其对应的组和用户 创建mysql组和mysql用户 groupadd mysql useradd -r -g mysql mysql chown -R mysql:mysql /usr/local/mysql (同理对应/var/lib/mysql) 5 修改配置文件:/etc/my.cnf 主库 [client] #client

g++: create a shared library (.so) with static glibc?

我与影子孤独终老i 提交于 2021-01-29 10:32:17
问题 I'm trying to create a shared library (.so file) that will include its own copy of glibc and link to it statically. I am already linking to libgcc and libstdc++ statically using -static-libgcc -static-libstdc++ in addition to -shared -fPIC and it works great. What combination of flags do I need to set to link to the static version of glibc as well? I tried adding -static to the lot but got this error: /usr/bin/ld: /home/.../x86_64-unknown-linux-gnu/4.6.2/crtbeginT.o: relocation R_X86_64_32

Yocto Bitbake Glibc build fails

那年仲夏 提交于 2021-01-29 10:08:01
问题 I'm trying to build a Yocto image but the build fails when compiling glibc. If I run just bitbake glibc -c compile I get a compilation error as follows: /usr/src/debug/glibc/2.27-r0/git/nptl/pthread_atfork.c:51: undefined reference to `__dso_handle' | /media/g/01D476BE2E4F26B0/AT91/SAMA5D27_SOM1/yocto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/glibc/2.27-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi.gcc-cross-initial-arm/../../libexec/arm-poky-linux-gnueabi.gcc

Why `pthread_rwlock_t`'s ABI differs a lot among versions?

僤鯓⒐⒋嵵緔 提交于 2021-01-29 05:53:52
问题 I am looking into different versions of implementation of pthread_rwlock_t . GLIBC2.30 typedef union { struct __pthread_rwlock_arch_t __data; char __size[__SIZEOF_PTHREAD_RWLOCK_T]; long int __align; } pthread_rwlock_t; struct __pthread_rwlock_arch_t { unsigned int __readers; unsigned int __writers; unsigned int __wrphase_futex; unsigned int __writers_futex; unsigned int __pad3; unsigned int __pad4; ... GLIBC2.17 typedef union { # ifdef __x86_64__ struct { int __lock; unsigned int __nr

linux下载mysql

∥☆過路亽.° 提交于 2021-01-28 04:49:48
1、下载地址 https://www.mysql.com/downloads/ 选择community server    点击DOWLOAD 选择版本,当前选择的5.6版本 点击下载mysql-5.6.38-linux-glibc2.12-i686.tar.gz 选择no thanks 2、安装mysql tar -xvzf mysql-5.6.38-linux-glibc2.12-i686.tar.gz mv mysql-5.6.38-linux-glibc2.12-i686/ mysql 添加系统mysql组和mysql用户: 执行命令:groupadd mysql和useradd -r -g mysql mysql 创建mysql数据目录,新目录不存在则创建   数据库数据默认目录datadir=/var/lib/mysql,可通过vim /etc/my.cnf 查看      修改后的目录是 mkdir -p data,没有创建文件夹,有不创建    修改目录权限   chown -R mysql:mysql ./ 初始化数据库  ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data 修改权限为root   [root

Wrapping a glibc function using the dynamic linker

我与影子孤独终老i 提交于 2021-01-27 08:00:47
问题 I am trying to wrap the GLIBC fstat function (it could be any other: it is just a proof of concept) by injecting my library to an executable. I do this by placing my library where the executable's RPATH is pointing with the name libc.so.6 . The source code of my library is the one below: #define _GNU_SOURCE #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> #include <dlfcn.h> int fstat(int fd, struct stat *buf){ typeof(fstat) *old_fstat; // Try with a printf... printf("HOOT!

Wrapping a glibc function using the dynamic linker

早过忘川 提交于 2021-01-27 07:58:08
问题 I am trying to wrap the GLIBC fstat function (it could be any other: it is just a proof of concept) by injecting my library to an executable. I do this by placing my library where the executable's RPATH is pointing with the name libc.so.6 . The source code of my library is the one below: #define _GNU_SOURCE #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> #include <dlfcn.h> int fstat(int fd, struct stat *buf){ typeof(fstat) *old_fstat; // Try with a printf... printf("HOOT!