Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Errors encountered in compiling glibc Error: invalid identifier for & how to solve quot;.ifdef"

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "errors encountered in compiling glibc Error: invalid identifier for" .ifdef "how to solve". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Because the default glibc version of the CentOS6 system is lower, I encountered Error: invalid identifier for ".ifdef" when trying to compile and upgrade, and record the solution here.

Compilation and installation

Download from the official website: ftp://ftp.gnu.org/gnu/glibc/

Download and compile and install wget http://ftp.gnu.org/gnu/glibc/glibc-2.15.tar.gzwget http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gztar-zxf glibc-2.15.tar.gztar-zxf glibc-ports-2.15.tar.gzmv glibc-ports-2.15 glibc-2.15/portsmkdir glibc-build-2.15cd glibc-build-2.15../glibc-2.15/configure- Prefix=/usr-- disable-profile-- enable-add-ons-- with-headers=/usr/include-- with-binutils=/usr/binmake all & & make install solves the error sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef" 1. Modify the file pt-initfini.c

Find the file nptl/sysdeps/pthread/pt-initfini.c in the glibc source directory, about 46 lines: asm ("\ n#include\" defs.h\ "")

Add code after that:

Asm ("\ n#if defined _ i686 & & defined _ ASSEMBLER__"); asm ("\ n#undef _ i686"); asm ("\ n#define _ i686 _ i686"); asm ("\ n#endif"); 2. Modify the file sysdep.h

Find the file sysdeps/unix/sysv/linux/i386/sysdep.h in the glibc source directory, about 30 lines: # include

Add code after that:

# if defined _ i686 & & defined _ ASSEMBLER__#undef _ i686#define _ i686 _ i686#endif3. Recompile make all & & make install to determine the current GLIBC version ldd-- version

Install successfully as follows

Ldd (GNU libc) 2.15Copyright (C) 2012 Free Software Foundation, Inc.This is free software; see the source for copying conditions. There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.Written by Roland McGrath and Ulrich Drepper. "errors encountered in compiling glibc Error: invalid identifier for" .ifdef "how to solve" is introduced here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report