├── .gitignore ├── LICENSE.TXT ├── README.md ├── glibc_version_header_gen.py ├── patches ├── cvs-common-symbols.diff ├── cvs-short-for-fnstsw.diff ├── extern_inline_addition.diff ├── fix_bad_version_checks.diff ├── fix_bad_version_checks_2.10.diff ├── fix_bad_version_checks_2.5.diff ├── fix_bad_version_checks_2.9.diff ├── fix_linker_failure.diff ├── fix_obstack_compat.diff ├── hvsep-remove.diff ├── no-pattern-rule-mixing.diff ├── remove_ctors_dtors.diff └── unwind.diff └── version_headers ├── x64 ├── force_link_glibc_2.10.2.h ├── force_link_glibc_2.11.3.h ├── force_link_glibc_2.12.2.h ├── force_link_glibc_2.13.h ├── force_link_glibc_2.14.1.h ├── force_link_glibc_2.14.h ├── force_link_glibc_2.15.h ├── force_link_glibc_2.16.h ├── force_link_glibc_2.17.h ├── force_link_glibc_2.18.h ├── force_link_glibc_2.19.h ├── force_link_glibc_2.20.h ├── force_link_glibc_2.21.h ├── force_link_glibc_2.22.h ├── force_link_glibc_2.23.h ├── force_link_glibc_2.24.h ├── force_link_glibc_2.25.h ├── force_link_glibc_2.26.h ├── force_link_glibc_2.27.h ├── force_link_glibc_2.5.1.h ├── force_link_glibc_2.5.h ├── force_link_glibc_2.6.1.h ├── force_link_glibc_2.6.h ├── force_link_glibc_2.7.h ├── force_link_glibc_2.8.h └── force_link_glibc_2.9.h └── x86 ├── force_link_glibc_2.10.2.h ├── force_link_glibc_2.11.3.h ├── force_link_glibc_2.12.2.h ├── force_link_glibc_2.13.h ├── force_link_glibc_2.14.1.h ├── force_link_glibc_2.14.h ├── force_link_glibc_2.15.h ├── force_link_glibc_2.16.h ├── force_link_glibc_2.17.h ├── force_link_glibc_2.18.h ├── force_link_glibc_2.19.h ├── force_link_glibc_2.20.h ├── force_link_glibc_2.21.h ├── force_link_glibc_2.22.h ├── force_link_glibc_2.23.h ├── force_link_glibc_2.24.h ├── force_link_glibc_2.25.h ├── force_link_glibc_2.26.h ├── force_link_glibc_2.27.h ├── force_link_glibc_2.5.1.h ├── force_link_glibc_2.5.h ├── force_link_glibc_2.6.1.h ├── force_link_glibc_2.6.h ├── force_link_glibc_2.7.h ├── force_link_glibc_2.8.h └── force_link_glibc_2.9.h /.gitignore: -------------------------------------------------------------------------------- 1 | builds 2 | glibc 3 | -------------------------------------------------------------------------------- /LICENSE.TXT: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Tom Mason 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Glibc version header generator 2 | Build portable Linux binaries, no more linker errors on users' older machines from incompatible glibc versions. 3 | 4 | # What is this? 5 | Essentially, this is a tool that allows you to specify the glibc version that you want to link against, regardless of what version is installed on your machine. 6 | This allows you to make portable Linux binaries, without having to build your binaries on an ancient distro (which is the current standard practice). 7 | 8 | # Why would I want that? 9 | So you can distribute a portable binary to your users. You know how on Windows, you can just download a zip with a program in it, unzip, double click, and the thing runs? Wouldn't it be nice if we could have that on Linux? 10 | There's no technical reason we can't, just standard practices that are hostile to this goal. 11 | My particular interest is using it for binaries of games, but it's useful for all sorts of things. 12 | 13 | # Why not just statically link glibc? 14 | A statically linked binary doesn't work unless you have the same version of glibc installed on the machine you run it on anyway. There is a [workaround](https://sourceware.org/glibc/wiki/FAQ#Even_statically_linked_programs_need_some_shared_libraries_which_is_not_acceptable_for_me.__What_can_I_do.3F) to this, but it has its disadvantages, so no one does it. 15 | 16 | 17 | # How does it work? 18 | Glibc uses something called symbol versioning. This means that when you use e.g., `malloc` in your program, the symbol the linker will actually link against is `malloc@GLIBC_YOUR_INSTALLED_VERSION` (actually, it will link to `malloc` from the most recent version of glibc that changed the implementaton of `malloc`, but you get the idea). 19 | This means that when you run your old program on a newer system, where `malloc` has been changed to, say, take its size as a string instead of an integer, that new crazy `malloc` will be `malloc@GLIBC_CRAZY_VERSION` but you'll still link to `malloc@OLD_SANE_VERSION`, and glibc will keep exporting the old symbol with a compatible implementation. 20 | This effectively make binaries forward compatible, as the system will always act like the version of glibc on the developers machine when they build the binary. 21 | The downside of this is that if I compile my super cool, new program on my bleeding edge Arch Linux machine, that binary is almost useless to anyone who isn't cool enough to use the same new version of glibc as me. 22 | I theorise that this is why almost no one ships Linux binaries - it's just too much of a pain in the ass. 23 | 24 | However, the version of a function that you link against _can_ be specified. 25 | The GNU assembler has a "psuedo-op" `.symver SYM,SYM@VERSION`, which forces the linker to use `SYM@VERSION` wherever you ask for `SYM`. 26 | This can be embedded in C source like so: `__asm__(".symver SYM,SYM@GLIBC_VERSION");`. 27 | Great, but I want to use glibc 2.13 for my whole program, not just one function in one translation unit. 28 | So, what we do to resolve this, is we generate a header file that contains these symver asm blocks for every symbol exposed by glibc. 29 | To do this, we build every version of glibc from 2.5 to current (open an issue if the latest version is no longer current please), check what symbols are exposed in all the binaries built by that version (glibc splits the C standard library into a few different binaries), and generate the header accordingly. 30 | Then, all you need to do is make sure that header is included in every translation unit in your build. 31 | This is as simple as adding `-include /path/to/glibc_version_header.h` to your compiler flags using whatever build system you use. 32 | 33 | ## Does that actually work? 34 | Yup, you just need to make sure all the binaries you're distributing are built with the magic header. 35 | I've built GCC and binutils with this technique on Debian 9 (glibc 2.24), and then run it successfully on Ubuntu 12.04 (glibc 2.15). 36 | It's worked out of the box for everything I've tried except building GCC itself, which required a little bit of messing, because it uses every obscure platform feature under the sun, many of which seem to have been invented almost for its sole use. 37 | 38 | # Caveats 39 | It pretty much works out of the box for almost everything in plain C. 40 | - If you want C++, you'll need to build libstdc++ with this enabled. That can be a little involved, but I'm working on a solution, to be available "soon". 41 | - So far, this work on x86\_64 code only. 42 | - Weak symbols don't work, you'll need to remove the entries for the functions you want weak references to. Almost no one uses them, however, so you're probably fine. 43 | - pthreads functions using wrong versions: If you use pthreads, you must use the `-pthread` flag, not `-lpthread`. You should be doing this anyway, however, so you're probably fine. 44 | `-lpthread` just adds libpthread.so to your link flags, but the proper way is `-pthread`, which also defines the `_REENTRANT` flag, which lets the build _know_ it's going to be linked to libpthread.so. This is important since libc has this horrible feature that pthreads functions are in libpthread.so, while the normal cstdlib functions are in libc6.so. However, a subset of pthreads functions are exposed in libc6.so as weak symbols, with noop implementations. This allows them to do a single compile of libc6.so, with appropriate locking calls added in to ensure thread safety where it should be ensured, but if you're not using threads (read: didn't link libpthread.so), the locking calls are noops. Because weak symbols don't work with this scheme, this messes up the link, so we only add the magic symver directives for these pthreads functions if `_REENTRANT` is defined. 45 | 46 | # Usage 47 | Just grab one of the [generated headers](version_headers), and add it to your compile flags. 48 | In CMake, this would be: 49 | ```cmake 50 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include /path/to/header.h") 51 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include /path/to/header.h") 52 | ``` 53 | 54 | For Autotools, just set your env vars: 55 | ```bash 56 | export CFLAGS="$CFLAGS -include /path/to/header.h" 57 | export CXXFLAGS="$CXXFLAGS -include /path/to/header.h" 58 | ``` 59 | 60 | I would also recommend adding `-static-libgcc -static-libstdc++` as well. 61 | 62 | # What glibc version should I use then? 63 | Depends on who you want to target. The oldest supported version is glibc 2.5, which was released in 2006. That's probably ancient enough. 64 | 65 | See the chart below for glibc versions found on common Linux distributions: 66 | 67 | | Distribution | glibc version | 68 | |--------------|---------------| 69 | | Debian 7 | 2.13 | 70 | | Debian 8 | 2.19 | 71 | | Debian 9 | 2.24 | 72 | | CentOS 6 | 2.12 | 73 | | CentOS 7 | 2.17 | 74 | | Ubuntu 14.04 | 2.19 | 75 | | Ubuntu 16.04 | 2.23 | 76 | | Ubuntu 18.04 | 2.27 | 77 | -------------------------------------------------------------------------------- /glibc_version_header_gen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess 4 | import sys 5 | import os 6 | import distutils.spawn 7 | import copy 8 | import shutil 9 | import multiprocessing 10 | import argparse 11 | 12 | basePath = os.path.dirname(os.path.realpath(__file__)) 13 | 14 | 15 | def extract_versions_from_installed_folder(folder, version, arch): 16 | files = [x.decode("utf-8").strip() for x in subprocess.check_output("find '" + folder + "' -name \"*.so\"", 17 | shell=True).split()] 18 | 19 | def starts_with_any(str, set): 20 | for item in set: 21 | if str.startswith(item): 22 | return True 23 | return False 24 | 25 | data = [] 26 | syms = {} 27 | syms_file = {} 28 | dupes = {} 29 | for f in files: 30 | 31 | # These are linker scripts that just forward to other .sos, not actual elf binaries 32 | if f.split("/")[-1] in {'libc.so', 'libm.so', 'libpthread.so'}: 33 | continue 34 | 35 | # Available versions will be listed in readelf output as function@GLIBC_version 36 | # Additionally, there will be a single function@@GLIBC_version entry, which defines the 37 | # default version. 38 | # See https://web.archive.org/web/20170124195801/https://www.akkadia.org/drepper/symbol-versioning section Static Linker 39 | command = "readelf -Ws '" + f + "' | grep \" [^ ]*@@GLIBC_[0-9.]*$\" -o" 40 | file_data = [x.decode("utf-8").strip() for x in 41 | subprocess.check_output(['/bin/bash', '-c', 'set -o pipefail; ' + command]).split()] 42 | 43 | library_name = f.split("/")[-1] 44 | if Version(2, 17) <= version <= Version(2, 27): 45 | # These are defined in both librt and libc, at different versions. file rt/Versions in 46 | # glibc source refers to them being moved from librt to libc, 47 | # but left behind for backwards compatibility 48 | if library_name.startswith("librt"): 49 | file_data = [x for x in file_data if not starts_with_any(x, {'clock_getcpuclockid', 'clock_nanosleep', 50 | 'clock_getres', 'clock_settime', 51 | 'clock_gettime'})] 52 | 53 | if arch == 'x86': 54 | if library_name.startswith("libc") or library_name.startswith("librt") or library_name.startswith("libnsl"): 55 | file_data = [x for x in file_data if not starts_with_any(x, {'pread', 'pread64', '__pread64', 56 | 'pwrite', 'pwrite64', '__pwrite64', 57 | 'open64', 58 | 'lseek64', 59 | '__finite', '__finitel', '__finitef'})] 60 | 61 | 62 | basename = os.path.basename(f) 63 | for line in file_data: 64 | sym, ver = line.split("@@") 65 | if sym not in syms: 66 | syms[sym] = ver 67 | syms_file[sym] = basename 68 | elif syms[sym] != ver: 69 | if sym not in dupes: 70 | dupes[sym] = (basename, syms_file[sym]) 71 | else: 72 | dupes[sym] += (basename,) 73 | 74 | if dupes: 75 | raise Exception("duplicate incompatible symbol versions found: " + str(dupes)) 76 | 77 | return syms 78 | 79 | 80 | def generate_header_string(syms, missingFuncs): 81 | pthread_funcs_in_libc_so = { 82 | "pthread_attr_destroy", 83 | "pthread_attr_init", 84 | "pthread_attr_getdetachstate", 85 | "pthread_attr_setdetachstate", 86 | "pthread_attr_getinheritsched", 87 | "pthread_attr_setinheritsched", 88 | "pthread_attr_getschedparam", 89 | "pthread_attr_setschedparam", 90 | "pthread_attr_getschedpolicy", 91 | "pthread_attr_setschedpolicy", 92 | "pthread_attr_getscope", 93 | "pthread_attr_setscope", 94 | "pthread_condattr_destroy", 95 | "pthread_condattr_init", 96 | "pthread_cond_broadcast", 97 | "pthread_cond_destroy", 98 | "pthread_cond_init", 99 | "pthread_cond_signalpthread_cond_wait", 100 | "pthread_cond_timedwait", 101 | "pthread_equal", 102 | "pthread_exit", 103 | "pthread_getschedparam", 104 | "pthread_setschedparam", 105 | "pthread_mutex_destroy", 106 | "pthread_mutex_init", 107 | "pthread_mutex_lock", 108 | "pthread_mutex_unlock", 109 | "pthread_self", 110 | "pthread_setcancelstate", 111 | "pthread_setcanceltype", 112 | "pthread_attr_init", 113 | "__register_atfork", 114 | "pthread_cond_init pthread_cond_destroy", 115 | "pthread_cond_wait pthread_cond_signal", 116 | "pthread_cond_broadcast pthread_cond_timedwait" 117 | } 118 | 119 | pthread_symbols_used_as_weak_in_libgcc = { 120 | "pthread_setspecific", 121 | "__pthread_key_create", 122 | "pthread_getspecific", 123 | "pthread_key_create", 124 | "pthread_once" 125 | } 126 | 127 | pthread_symbols_used_as_weak_in_libstdcpp = { 128 | "pthread_setspecific", 129 | "pthread_key_delete", 130 | "__pthread_key_create", 131 | "pthread_once", 132 | "pthread_key_create", 133 | "pthread_getspecific", 134 | "pthread_join", 135 | "pthread_detach", 136 | "pthread_create" 137 | } 138 | 139 | strings = [ 140 | "#if !defined(SET_GLIBC_LINK_VERSIONS_HEADER) && !defined(__ASSEMBLER__)", 141 | "#define SET_GLIBC_LINK_VERSIONS_HEADER" 142 | ] 143 | 144 | for sym in sorted(syms.keys()): 145 | line = '__asm__(".symver ' + sym + ',' + sym + '@' + syms[sym] + '");' 146 | 147 | if sym in pthread_funcs_in_libc_so or sym in pthread_symbols_used_as_weak_in_libstdcpp or sym in \ 148 | pthread_symbols_used_as_weak_in_libgcc: 149 | line = "#ifdef _REENTRANT\n" + line + "\n#endif" 150 | if sym in pthread_symbols_used_as_weak_in_libgcc: 151 | line = "#ifndef IN_LIBGCC2\n" + line + "\n#endif" 152 | if sym in pthread_symbols_used_as_weak_in_libstdcpp: 153 | line = "#ifndef _GLIBCXX_SHARED\n" + line + "\n#endif" 154 | 155 | strings.append(line) 156 | 157 | for sym in sorted(list(missingFuncs)): 158 | strings.append( 159 | '__asm__(".symver ' + sym + ',' + sym + '@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");') 160 | 161 | strings.append("#endif") 162 | strings.append("") 163 | 164 | return "\n".join(strings) 165 | 166 | 167 | def apply_patches(glibcDir, version, arch): 168 | patches_table = { 169 | # patch x <= version <= y 170 | "extern_inline_addition.diff": (Version(2, 5), Version(2, 5, 1)), 171 | "fix_obstack_compat.diff": (Version(2, 5), Version(2, 17)), 172 | "no-pattern-rule-mixing.diff": (Version(2, 5), Version(2, 10, 2)), 173 | "fix_linker_failure.diff": (Version(2, 5), Version(2, 9)), 174 | "remove_ctors_dtors.diff": (Version(2, 5), Version(2, 12, 2)), 175 | "fix_bad_version_checks_2.5.diff": (Version(2, 5), Version(2, 6, 1)), 176 | "fix_bad_version_checks_2.9.diff": (Version(2, 7), Version(2, 9)), 177 | "fix_bad_version_checks_2.10.diff": (Version(2, 10), Version(2, 12, 2)), 178 | "fix_bad_version_checks.diff": (Version(2, 13), Version(2, 18)), 179 | "hvsep-remove.diff": (Version(2, 16), Version(2, 16)), 180 | "cvs-common-symbols.diff": (Version(2, 23), Version(2, 25)), 181 | } 182 | patches_x86_table = { 183 | "unwind.diff": (Version(2, 5), Version(2, 10, 2)), 184 | "cvs-short-for-fnstsw.diff": (Version(2, 5), Version(2, 7)), 185 | } 186 | 187 | def apply_patches_from_table(glibcDir, version, table): 188 | for patch, v_limits in table.items(): 189 | if v_limits[0] <= version <= v_limits[1]: 190 | patch_path = "{}/patches/{}".format(basePath, patch) 191 | subprocess.check_call(["git", "apply", patch_path], cwd=glibcDir) 192 | 193 | apply_patches_from_table(glibcDir, version, patches_table) 194 | if arch == 'x86': 195 | apply_patches_from_table(glibcDir, version, patches_x86_table) 196 | 197 | 198 | def get_glibc_binaries(version, arch): 199 | """ 200 | Downloads and builds the specified version (git tag) of glibc. 201 | Returns the installed folder. 202 | """ 203 | glibcDir = basePath + "/glibc" 204 | buildDir = basePath + "/builds/" + str(version) + "/build" 205 | installDir = basePath + "/builds/" + str(version) + "/install" 206 | 207 | if not os.path.exists(glibcDir): 208 | subprocess.check_call(["git", "clone", "git://sourceware.org/git/glibc.git", glibcDir], cwd=basePath) 209 | 210 | if not os.path.exists(installDir + "/build_succeeded"): 211 | subprocess.check_call(["git", "reset", "--hard", "HEAD"], cwd=glibcDir) 212 | subprocess.check_call(["git", "clean", "-dxf"], cwd=glibcDir) 213 | 214 | subprocess.check_call(["git", "checkout", str(version)], cwd=glibcDir) 215 | 216 | apply_patches(glibcDir, version, arch) 217 | 218 | if os.path.exists(buildDir): 219 | shutil.rmtree(buildDir) 220 | os.makedirs(buildDir) 221 | 222 | if os.path.exists(installDir): 223 | shutil.rmtree(installDir) 224 | os.makedirs(installDir) 225 | 226 | def add_flags(env, name, value): 227 | if name in env: 228 | env[name] += ' ' + value 229 | else: 230 | env[name] = value 231 | return env 232 | 233 | env = copy.deepcopy(os.environ) 234 | env["CC"] = "gcc" 235 | if Version(2, 5) <= version <= Version(2, 16): 236 | env = add_flags(env, "CFLAGS", "-U_FORTIFY_SOURCE -O2 -fno-stack-protector") 237 | if Version(2, 5) <= version <= Version(2, 21): 238 | gcc_flags = subprocess.check_output(['gcc', '-v'], stderr=subprocess.STDOUT).decode() 239 | if '--enable-default-pie' in gcc_flags: 240 | env = add_flags(env, "LDFLAGS", "-no-pie") 241 | 242 | jobString = "-j" + str(multiprocessing.cpu_count()) 243 | 244 | configure_args = [glibcDir + "/configure", "--disable-werror", "--disable-sanity-checks"] 245 | 246 | if arch == 'x86': 247 | env["CC"] = "gcc -m32 -U__i686" 248 | env = add_flags(env, "CFLAGS", "-m32 -march=i686 -O2") 249 | env = add_flags(env, "LDFLAGS", "-m32 -march=i686") 250 | 251 | config_guess = subprocess.check_output([os.path.join(glibcDir, 'scripts', 'config.guess')]).decode() 252 | # http://www.linuxfromscratch.org/lfs/view/jh/chapter05/glibc.html 253 | configure_args.extend(['--host=i686-linux-gnu', 254 | '--build=%s' % config_guess, 255 | 'libc_cv_forced_unwind=yes', 256 | 'libc_cv_ctors_header=yes', 257 | 'libc_cv_c_cleanup=yes']) 258 | # -jN fails with "cannot create glibc-2.12.2/build/iconvdata/stamp.oS: File exists" 259 | jobString = "-j1" 260 | subprocess.check_call(configure_args, cwd=buildDir, env=env) 261 | subprocess.check_call(["make", jobString], cwd=buildDir) 262 | subprocess.check_call(["make", "install_root=" + installDir, "install", jobString], cwd=buildDir) 263 | 264 | with open(installDir + "/build_succeeded", "wb") as f: 265 | pass 266 | 267 | return installDir 268 | 269 | 270 | def check_have_required_programs(): 271 | requiredPrograms = ["gcc", "make", "git", "readelf", "grep", "gawk", "bison", "msgfmt", "makeinfo", "autoconf"] 272 | 273 | missing = [] 274 | 275 | for p in requiredPrograms: 276 | if distutils.spawn.find_executable(p) is None: 277 | missing.append(p) 278 | 279 | if missing: 280 | raise Exception("missing programs: " + str(missing) + ", please install via your os package manager") 281 | 282 | 283 | class Version(object): 284 | def __init__(self, *args): 285 | if len(args) > 3 or len(args) < 2: 286 | raise Exception("invalid version: " + str(args)) 287 | 288 | self.major = int(args[0]) 289 | self.minor = int(args[1]) 290 | 291 | if len(args) == 3: 292 | self.patch = int(args[2]) 293 | else: 294 | self.patch = 0 295 | 296 | def version_as_str(self): 297 | s = str(self.major) + "." + str(self.minor) 298 | if self.patch != 0: 299 | s += "." + str(self.patch) 300 | 301 | return s 302 | 303 | def __str__(self): 304 | return "glibc-" + self.version_as_str() 305 | 306 | def __repr__(self): 307 | return self.__str__() 308 | 309 | def __hash__(self): 310 | return hash((self.major, self.minor, self.patch)) 311 | 312 | def __lt__(self, other): 313 | return (self.major, self.minor, self.patch) < (other.major, other.minor, other.patch) 314 | 315 | def __le__(self, other): 316 | return (self.major, self.minor, self.patch) <= (other.major, other.minor, other.patch) 317 | 318 | def __gt__(self, other): 319 | return (self.major, self.minor, self.patch) > (other.major, other.minor, other.patch) 320 | 321 | def __ge__(self, other): 322 | return (self.major, self.minor, self.patch) >= (other.major, other.minor, other.patch) 323 | 324 | def __eq__(self, other): 325 | return (self.major, self.minor, self.patch) == (other.major, other.minor, other.patch) 326 | 327 | def __ne__(self, other): 328 | return (self.major, self.minor, self.patch) != (other.major, other.minor, other.patch) 329 | 330 | 331 | SUPPORTED_VERSIONS = [ 332 | Version(2, 5), 333 | Version(2, 5, 1), 334 | Version(2, 6), 335 | Version(2, 6, 1), 336 | Version(2, 7), 337 | Version(2, 8), 338 | Version(2, 9), 339 | Version(2, 10, 2), 340 | Version(2, 11, 3), 341 | Version(2, 12, 2), 342 | Version(2, 13), 343 | Version(2, 14), 344 | Version(2, 14, 1), 345 | Version(2, 15), 346 | Version(2, 16), 347 | Version(2, 17), 348 | Version(2, 18), 349 | Version(2, 19), 350 | Version(2, 20), 351 | Version(2, 21), 352 | Version(2, 22), 353 | Version(2, 23), 354 | Version(2, 24), 355 | Version(2, 25), 356 | Version(2, 26), 357 | Version(2, 27), 358 | ] 359 | 360 | 361 | def main(): 362 | check_have_required_programs() 363 | 364 | parser = argparse.ArgumentParser() 365 | parser.add_argument('-v', '--version', type=str, help='compile only specific glibc version', action='append', 366 | choices=[v.version_as_str() for v in SUPPORTED_VERSIONS]) 367 | parser.add_argument('-a', '--arch', type=str, help='compile for specific processor architecture', 368 | choices=['x86', 'x64'], default='x64') 369 | args = parser.parse_args() 370 | 371 | if args.version: 372 | print("Warning, requesting specific versions may mean you miss out on defining missing symbols") 373 | requested_versions = [Version(*v.split('.')) for v in args.version] 374 | else: 375 | requested_versions = SUPPORTED_VERSIONS # build all by default 376 | 377 | versionHeadersPath = os.path.join(basePath, "version_headers", args.arch) 378 | if os.path.exists(versionHeadersPath): 379 | shutil.rmtree(versionHeadersPath) 380 | 381 | syms = {} 382 | for version in requested_versions: 383 | print("generating data for version:", version) 384 | installDir = get_glibc_binaries(version, args.arch) 385 | syms[version] = extract_versions_from_installed_folder(installDir, version, args.arch) 386 | 387 | allsyms = set.union(set(), *syms.values()) 388 | for version in requested_versions: 389 | print("writing header for version:", version) 390 | missingFuncs = allsyms - set(syms[version].keys()) 391 | headerData = generate_header_string(syms[version], missingFuncs) 392 | 393 | if not os.path.exists(versionHeadersPath): 394 | os.makedirs(versionHeadersPath) 395 | 396 | with open(versionHeadersPath + "/force_link_glibc_" + version.version_as_str() + ".h", 'w') as f: 397 | f.write(headerData) 398 | 399 | 400 | if __name__ == "__main__": 401 | main() 402 | -------------------------------------------------------------------------------- /patches/cvs-common-symbols.diff: -------------------------------------------------------------------------------- 1 | commit 388b4f1a02f3a801965028bbfcd48d905638b797 2 | Author: H.J. Lu 3 | Date: Fri Jun 23 14:38:46 2017 -0700 4 | 5 | Avoid .symver on common symbols [BZ #21666] 6 | 7 | The .symver directive on common symbol just creates a new common symbol, 8 | not an alias and the newer assembler with the bug fix for 9 | 10 | https://sourceware.org/bugzilla/show_bug.cgi?id=21661 11 | 12 | will issue an error. Before the fix, we got 13 | 14 | $ readelf -sW libc.so | grep "loc[12s]" 15 | 5109: 00000000003a0608 8 OBJECT LOCAL DEFAULT 36 loc1 16 | 5188: 00000000003a0610 8 OBJECT LOCAL DEFAULT 36 loc2 17 | 5455: 00000000003a0618 8 OBJECT LOCAL DEFAULT 36 locs 18 | 6575: 00000000003a05f0 8 OBJECT GLOBAL DEFAULT 36 locs@GLIBC_2.2.5 19 | 7156: 00000000003a05f8 8 OBJECT GLOBAL DEFAULT 36 loc1@GLIBC_2.2.5 20 | 7312: 00000000003a0600 8 OBJECT GLOBAL DEFAULT 36 loc2@GLIBC_2.2.5 21 | 22 | in libc.so. The versioned loc1, loc2 and locs have the wrong addresses. 23 | After the fix, we got 24 | 25 | $ readelf -sW libc.so | grep "loc[12s]" 26 | 6570: 000000000039e3b8 8 OBJECT GLOBAL DEFAULT 34 locs@GLIBC_2.2.5 27 | 7151: 000000000039e3c8 8 OBJECT GLOBAL DEFAULT 34 loc1@GLIBC_2.2.5 28 | 7307: 000000000039e3c0 8 OBJECT GLOBAL DEFAULT 34 loc2@GLIBC_2.2.5 29 | 30 | [BZ #21666] 31 | * misc/regexp.c (loc1): Add __attribute__ ((nocommon)); 32 | (loc2): Likewise. 33 | (locs): Likewise. 34 | 35 | diff --git a/misc/regexp.c b/misc/regexp.c 36 | index 19d76c0c37..eaea7c3b89 100644 37 | --- a/misc/regexp.c 38 | +++ b/misc/regexp.c 39 | @@ -29,14 +29,15 @@ 40 | 41 | #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_23) 42 | 43 | -/* Define the variables used for the interface. */ 44 | -char *loc1; 45 | -char *loc2; 46 | +/* Define the variables used for the interface. Avoid .symver on common 47 | + symbol, which just creates a new common symbol, not an alias. */ 48 | +char *loc1 __attribute__ ((nocommon)); 49 | +char *loc2 __attribute__ ((nocommon)); 50 | compat_symbol (libc, loc1, loc1, GLIBC_2_0); 51 | compat_symbol (libc, loc2, loc2, GLIBC_2_0); 52 | 53 | /* Although we do not support the use we define this variable as well. */ 54 | -char *locs; 55 | +char *locs __attribute__ ((nocommon)); 56 | compat_symbol (libc, locs, locs, GLIBC_2_0); 57 | 58 | 59 | -------------------------------------------------------------------------------- /patches/cvs-short-for-fnstsw.diff: -------------------------------------------------------------------------------- 1 | taken from the trunk: 2 | 3 | 2008-01-12 H.J. Lu 4 | 5 | * sysdeps/i386/fpu/ftestexcept.c (fetestexcept): Use short for fnstsw. 6 | 7 | diff --git a/sysdeps/i386/fpu/ftestexcept.c b/sysdeps/i386/fpu/ftestexcept.c 8 | index 9038e04..1979fe1 100644 9 | --- a/sysdeps/i386/fpu/ftestexcept.c 10 | +++ b/sysdeps/i386/fpu/ftestexcept.c 11 | @@ -26,7 +26,7 @@ 12 | int 13 | fetestexcept (int excepts) 14 | { 15 | - int temp; 16 | + short temp; 17 | int xtemp = 0; 18 | 19 | /* Get current exceptions. */ 20 | -------------------------------------------------------------------------------- /patches/extern_inline_addition.diff: -------------------------------------------------------------------------------- 1 | most of 2 | commit b037a293a48718af30d706c2e18c929d0e69a621 3 | Author: Ulrich Drepper 4 | Date: Sat Mar 17 17:04:28 2007 +0000 5 | 6 | * configure.in (libc_cv_gnu89_inline): Test for -fgnu89-inline. 7 | 8 | plus partial commit 965cba048c978a2841c537383ed3408259c918f3 (configure) 9 | diff --git a/Makeconfig b/Makeconfig 10 | index 5a1aebccff..d79019f843 100644 11 | --- a/Makeconfig 12 | +++ b/Makeconfig 13 | @@ -674,7 +674,7 @@ CPPFLAGS = $($(subdir)-CPPFLAGS) $(+includes) $(defines) \ 14 | $(foreach lib,$(libof-$(basename $(@F))) \ 15 | $(libof-$(&5 98 | echo "${ECHO_T}$libc_cv_ssp" >&6 99 | 100 | 101 | +echo "$as_me:$LINENO: checking for -fgnu89-inline" >&5 102 | +echo $ECHO_N "checking for -fgnu89-inline... $ECHO_C" >&6 103 | +if test "${libc_cv_gnu89_inline+set}" = set; then 104 | + echo $ECHO_N "(cached) $ECHO_C" >&6 105 | +else 106 | + cat > conftest.c <&5 117 | + (eval $ac_try) 2>&5 118 | + ac_status=$? 119 | + echo "$as_me:$LINENO: \$? = $ac_status" >&5 120 | + (exit $ac_status); }; } 121 | +then 122 | + libc_cv_gnu89_inline=yes 123 | +else 124 | + libc_cv_gnu89_inline=no 125 | +fi 126 | +rm -f conftest* 127 | +fi 128 | +echo "$as_me:$LINENO: result: $libc_cv_gnu89_inline" >&5 129 | +echo "${ECHO_T}$libc_cv_gnu89_inline" >&6 130 | +if test $libc_cv_gnu89_inline = yes; then 131 | + libc_cv_gnu89_inline=-fgnu89-inline 132 | +else 133 | + libc_cv_gnu89_inline= 134 | +fi 135 | + 136 | + 137 | if test $elf != yes; then 138 | echo "$as_me:$LINENO: checking for .init and .fini sections" >&5 139 | echo $ECHO_N "checking for .init and .fini sections... $ECHO_C" >&6 140 | @@ -8526,6 +8562,7 @@ s,@libc_cv_fpie@,$libc_cv_fpie,;t t 141 | s,@libc_cv_hashstyle@,$libc_cv_hashstyle,;t t 142 | s,@fno_unit_at_a_time@,$fno_unit_at_a_time,;t t 143 | s,@libc_cv_ssp@,$libc_cv_ssp,;t t 144 | +s,@libc_cv_gnu89_inline@,$libc_cv_gnu89_inline,;t t 145 | s,@libc_cv_have_initfini@,$libc_cv_have_initfini,;t t 146 | s,@no_whole_archive@,$no_whole_archive,;t t 147 | s,@exceptions@,$exceptions,;t t 148 | diff --git a/configure.in b/configure.in 149 | index 924b0406cb..427a4d0812 100644 150 | --- a/configure.in 151 | +++ b/configure.in 152 | @@ -1641,6 +1641,30 @@ fi 153 | rm -f conftest*]) 154 | AC_SUBST(libc_cv_ssp) 155 | 156 | +AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl 157 | +cat > conftest.c <&AS_MESSAGE_LOG_FD]) 167 | +then 168 | + libc_cv_gnu89_inline=yes 169 | +else 170 | + libc_cv_gnu89_inline=no 171 | +fi 172 | +rm -f conftest*]) 173 | +if test $libc_cv_gnu89_inline = yes; then 174 | + libc_cv_gnu89_inline=-fgnu89-inline 175 | +else 176 | + libc_cv_gnu89_inline= 177 | +fi 178 | +AC_SUBST(libc_cv_gnu89_inline) 179 | + 180 | if test $elf != yes; then 181 | AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini, 182 | [AC_TRY_COMPILE(, [asm (".section .init"); 183 | diff --git a/ctype/ctype.h b/ctype/ctype.h 184 | index e08545359d..9ae7fb6088 100644 185 | --- a/ctype/ctype.h 186 | +++ b/ctype/ctype.h 187 | @@ -187,13 +187,13 @@ __exctype (_tolower); 188 | # endif 189 | 190 | # ifdef __USE_EXTERN_INLINES 191 | -extern __inline int 192 | +__extern_inline int 193 | __NTH (tolower (int __c)) 194 | { 195 | return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c; 196 | } 197 | 198 | -extern __inline int 199 | +__extern_inline int 200 | __NTH (toupper (int __c)) 201 | { 202 | return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c; 203 | diff --git a/hurd/hurd.h b/hurd/hurd.h 204 | index 0dc9f2158b..642ea43b7b 100644 205 | --- a/hurd/hurd.h 206 | +++ b/hurd/hurd.h 207 | @@ -44,7 +45,7 @@ 208 | #include 209 | 210 | #ifndef _HURD_H_EXTERN_INLINE 211 | -#define _HURD_H_EXTERN_INLINE extern __inline 212 | +#define _HURD_H_EXTERN_INLINE __extern_inline 213 | #endif 214 | 215 | _HURD_H_EXTERN_INLINE int 216 | diff --git a/hurd/hurd/fd.h b/hurd/hurd/fd.h 217 | index ad11367f3b..08d4407e88 100644 218 | --- a/hurd/hurd/fd.h 219 | +++ b/hurd/hurd/fd.h 220 | @@ -52,7 +52,7 @@ extern struct mutex _hurd_dtable_lock; /* Locks those two variables. */ 221 | #include 222 | 223 | #ifndef _HURD_FD_H_EXTERN_INLINE 224 | -#define _HURD_FD_H_EXTERN_INLINE extern __inline 225 | +#define _HURD_FD_H_EXTERN_INLINE __extern_inline 226 | #endif 227 | 228 | /* Returns the descriptor cell for FD. If FD is invalid or unused, return 229 | diff --git a/hurd/hurd/port.h b/hurd/hurd/port.h 230 | index 4e7bbebc18..a1803c36a5 100644 231 | --- a/hurd/hurd/port.h 232 | +++ b/hurd/hurd/port.h 233 | @@ -55,7 +56,7 @@ struct hurd_port 234 | 235 | 236 | #ifndef _HURD_PORT_H_EXTERN_INLINE 237 | -#define _HURD_PORT_H_EXTERN_INLINE extern __inline 238 | +#define _HURD_PORT_H_EXTERN_INLINE __extern_inline 239 | #endif 240 | 241 | 242 | diff --git a/hurd/hurd/signal.h b/hurd/hurd/signal.h 243 | index 238a73f19c..c5b04f434c 100644 244 | --- a/hurd/hurd/signal.h 245 | +++ b/hurd/hurd/signal.h 246 | @@ -126,7 +126,7 @@ extern struct hurd_sigstate *_hurd_self_sigstate (void) 247 | __attribute__ ((__const__)); 248 | 249 | #ifndef _HURD_SIGNAL_H_EXTERN_INLINE 250 | -#define _HURD_SIGNAL_H_EXTERN_INLINE extern __inline 251 | +#define _HURD_SIGNAL_H_EXTERN_INLINE __extern_inline 252 | #endif 253 | 254 | _HURD_SIGNAL_H_EXTERN_INLINE struct hurd_sigstate * 255 | diff --git a/hurd/hurd/threadvar.h b/hurd/hurd/threadvar.h 256 | index 5e7441f921..a0535f7596 100644 257 | --- a/hurd/hurd/threadvar.h 258 | +++ b/hurd/hurd/threadvar.h 259 | @@ -74,7 +74,7 @@ enum __hurd_threadvar_index 260 | 261 | 262 | #ifndef _HURD_THREADVAR_H_EXTERN_INLINE 263 | -#define _HURD_THREADVAR_H_EXTERN_INLINE extern __inline 264 | +#define _HURD_THREADVAR_H_EXTERN_INLINE __extern_inline 265 | #endif 266 | 267 | /* Return the location of the value for the per-thread variable with index 268 | diff --git a/hurd/hurd/userlink.h b/hurd/hurd/userlink.h 269 | index 65179acac6..34457e7a0f 100644 270 | --- a/hurd/hurd/userlink.h 271 | +++ b/hurd/hurd/userlink.h 272 | @@ -71,7 +71,7 @@ struct hurd_userlink 273 | 274 | 275 | #ifndef _HURD_USERLINK_H_EXTERN_INLINE 276 | -#define _HURD_USERLINK_H_EXTERN_INLINE extern __inline 277 | +#define _HURD_USERLINK_H_EXTERN_INLINE __extern_inline 278 | #endif 279 | 280 | 281 | diff --git a/io/sys/stat.h b/io/sys/stat.h 282 | index 4cc0b429a2..d1f4484185 100644 283 | --- a/io/sys/stat.h 284 | +++ b/io/sys/stat.h 285 | @@ -430,28 +431,28 @@ extern int __xmknodat (int __ver, int __fd, __const char *__path, 286 | #if defined __GNUC__ && __GNUC__ >= 2 287 | /* Inlined versions of the real stat and mknod functions. */ 288 | 289 | -extern __inline__ int 290 | +__extern_inline int 291 | __NTH (stat (__const char *__path, struct stat *__statbuf)) 292 | { 293 | return __xstat (_STAT_VER, __path, __statbuf); 294 | } 295 | 296 | # if defined __USE_BSD || defined __USE_XOPEN_EXTENDED 297 | -extern __inline__ int 298 | +__extern_inline int 299 | __NTH (lstat (__const char *__path, struct stat *__statbuf)) 300 | { 301 | return __lxstat (_STAT_VER, __path, __statbuf); 302 | } 303 | # endif 304 | 305 | -extern __inline__ int 306 | +__extern_inline int 307 | __NTH (fstat (int __fd, struct stat *__statbuf)) 308 | { 309 | return __fxstat (_STAT_VER, __fd, __statbuf); 310 | } 311 | 312 | # ifdef __USE_ATFILE 313 | -extern __inline__ int 314 | +__extern_inline int 315 | __NTH (fstatat (int __fd, __const char *__filename, struct stat *__statbuf, 316 | int __flag)) 317 | { 318 | @@ -460,7 +461,7 @@ __NTH (fstatat (int __fd, __const char *__filename, struct stat *__statbuf, 319 | # endif 320 | 321 | # if defined __USE_MISC || defined __USE_BSD 322 | -extern __inline__ int 323 | +__extern_inline int 324 | __NTH (mknod (__const char *__path, __mode_t __mode, __dev_t __dev)) 325 | { 326 | return __xmknod (_MKNOD_VER, __path, __mode, &__dev); 327 | @@ -468,7 +469,7 @@ __NTH (mknod (__const char *__path, __mode_t __mode, __dev_t __dev)) 328 | # endif 329 | 330 | # ifdef __USE_ATFILE 331 | -extern __inline__ int 332 | +__extern_inline int 333 | __NTH (mknodat (int __fd, __const char *__path, __mode_t __mode, 334 | __dev_t __dev)) 335 | { 336 | @@ -479,28 +480,28 @@ __NTH (mknodat (int __fd, __const char *__path, __mode_t __mode, 337 | # if defined __USE_LARGEFILE64 \ 338 | && (! defined __USE_FILE_OFFSET64 \ 339 | || (defined __REDIRECT_NTH && defined __OPTIMIZE__)) 340 | -extern __inline__ int 341 | +__extern_inline int 342 | __NTH (stat64 (__const char *__path, struct stat64 *__statbuf)) 343 | { 344 | return __xstat64 (_STAT_VER, __path, __statbuf); 345 | } 346 | 347 | # if defined __USE_BSD || defined __USE_XOPEN_EXTENDED 348 | -extern __inline__ int 349 | +__extern_inline int 350 | __NTH (lstat64 (__const char *__path, struct stat64 *__statbuf)) 351 | { 352 | return __lxstat64 (_STAT_VER, __path, __statbuf); 353 | } 354 | # endif 355 | 356 | -extern __inline__ int 357 | +__extern_inline int 358 | __NTH (fstat64 (int __fd, struct stat64 *__statbuf)) 359 | { 360 | return __fxstat64 (_STAT_VER, __fd, __statbuf); 361 | } 362 | 363 | # ifdef __USE_GNU 364 | -extern __inline__ int 365 | +__extern_inline int 366 | __NTH (fstatat64 (int __fd, __const char *__filename, struct stat64 *__statbuf, 367 | int __flag)) 368 | { 369 | diff --git a/libio/bits/stdio.h b/libio/bits/stdio.h 370 | index 2d44fad1f5..4d23f28db0 100644 371 | --- a/libio/bits/stdio.h 372 | +++ b/libio/bits/stdio.h 373 | @@ -24,7 +24,7 @@ 374 | #ifdef __cplusplus 375 | # define __STDIO_INLINE inline 376 | #else 377 | -# define __STDIO_INLINE extern __inline 378 | +# define __STDIO_INLINE __extern_inline 379 | #endif 380 | 381 | 382 | diff --git a/libio/bits/stdio2.h b/libio/bits/stdio2.h 383 | index 0582edbccb..924a4817e7 100644 384 | --- a/libio/bits/stdio2.h 385 | +++ b/libio/bits/stdio2.h 386 | @@ -75,7 +75,7 @@ extern int __vprintf_chk (int __flag, __const char *__restrict __format, 387 | extern char *__gets_chk (char *__str, size_t) __wur; 388 | extern char *__REDIRECT (__gets_alias, (char *__str), gets) __wur; 389 | 390 | -extern __always_inline __wur char * 391 | +__extern_always_inline __wur char * 392 | gets (char *__str) 393 | { 394 | if (__bos (__str) != (size_t) -1) 395 | @@ -89,7 +89,7 @@ extern char *__REDIRECT (__fgets_alias, 396 | (char *__restrict __s, int __n, 397 | FILE *__restrict __stream), fgets) __wur; 398 | 399 | -extern __always_inline __wur char * 400 | +__extern_always_inline __wur char * 401 | fgets (char *__restrict __s, int __n, FILE *__restrict __stream) 402 | { 403 | if (__bos (__s) != (size_t) -1 404 | @@ -105,7 +105,7 @@ extern char *__REDIRECT (__fgets_unlocked_alias, 405 | (char *__restrict __s, int __n, 406 | FILE *__restrict __stream), fgets_unlocked) __wur; 407 | 408 | -extern __always_inline __wur char * 409 | +__extern_always_inline __wur char * 410 | fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream) 411 | { 412 | if (__bos (__s) != (size_t) -1 413 | diff --git a/mach/lock-intern.h b/mach/lock-intern.h 414 | index 5aabc4a11f..d42a378f4d 100644 415 | --- a/mach/lock-intern.h 416 | +++ b/mach/lock-intern.h 417 | @@ -22,7 +22,7 @@ 418 | #include 419 | 420 | #ifndef _EXTERN_INLINE 421 | -#define _EXTERN_INLINE extern __inline 422 | +#define _EXTERN_INLINE __extern_inline 423 | #endif 424 | 425 | 426 | diff --git a/mach/mach/mig_support.h b/mach/mach/mig_support.h 427 | index 4cc3e987a9..f02e8d4f83 100644 428 | --- a/mach/mach/mig_support.h 429 | +++ b/mach/mach/mig_support.h 430 | @@ -67,12 +67,12 @@ extern void mig_reply_setup (const mach_msg_header_t *__request, 431 | /* Idiocy support function. */ 432 | extern vm_size_t mig_strncpy (char *__dst, const char *__src, vm_size_t __len); 433 | extern vm_size_t __mig_strncpy (char *__dst, const char *__src, vm_size_t); 434 | -extern __inline vm_size_t 435 | +__extern_inline vm_size_t 436 | __mig_strncpy (char *__dst, const char *__src, vm_size_t __len) 437 | { 438 | return __stpncpy (__dst, __src, __len) - __dst; 439 | } 440 | -extern __inline vm_size_t 441 | +__extern_inline vm_size_t 442 | mig_strncpy (char *__dst, const char *__src, vm_size_t __len) 443 | { 444 | return __mig_strncpy (__dst, __src, __len); 445 | diff --git a/math/bits/cmathcalls.h b/math/bits/cmathcalls.h 446 | index c680c6d8e4..db7f69c72e 100644 447 | --- a/math/bits/cmathcalls.h 448 | +++ b/math/bits/cmathcalls.h 449 | @@ -135,21 +135,21 @@ __MATHDECL (_Mdouble_,creal, (_Mdouble_complex_ __z)); 450 | #if defined __GNUC__ && !__GNUC_PREREQ (2, 97) && defined __OPTIMIZE__ 451 | 452 | /* Imaginary part of Z. */ 453 | -extern __inline _Mdouble_ 454 | +__extern_inline _Mdouble_ 455 | __MATH_PRECNAME(cimag) (_Mdouble_complex_ __z) __THROW 456 | { 457 | return __imag__ __z; 458 | } 459 | 460 | /* Real part of Z. */ 461 | -extern __inline _Mdouble_ 462 | +__extern_inline _Mdouble_ 463 | __MATH_PRECNAME(creal) (_Mdouble_complex_ __z) __THROW 464 | { 465 | return __real__ __z; 466 | } 467 | 468 | /* Complex conjugate of Z. */ 469 | -extern __inline _Mdouble_complex_ 470 | +__extern_inline _Mdouble_complex_ 471 | __MATH_PRECNAME(conj) (_Mdouble_complex_ __z) __THROW 472 | { 473 | return __extension__ ~__z; 474 | diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h 475 | index ce5e83d571..ab7d327c59 100644 476 | --- a/misc/sys/cdefs.h 477 | +++ b/misc/sys/cdefs.h 478 | @@ -279,6 +279,17 @@ 479 | # define __always_inline __inline 480 | #endif 481 | 482 | +/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 483 | + inline semantics, unless -fgnu89-inline is used. */ 484 | +#ifdef __GNUC_STDC_INLINE__ 485 | +# define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) 486 | +# define __extern_always_inline \ 487 | + extern __always_inline __attribute__ ((__gnu_inline__)) 488 | +#else 489 | +# define __extern_inline extern __inline 490 | +# define __extern_always_inline extern __always_inline 491 | +#endif 492 | + 493 | /* It is possible to compile containing GCC extensions even if GCC is 494 | run in pedantic mode if the uses are carefully marked using the 495 | `__extension__' keyword. But this is not generally available before 496 | diff --git a/nptl/sysdeps/pthread/bits/libc-lock.h b/nptl/sysdeps/pthread/bits/libc-lock.h 497 | index 795caa7135..de72e96498 100644 498 | --- a/nptl/sysdeps/pthread/bits/libc-lock.h 499 | +++ b/nptl/sysdeps/pthread/bits/libc-lock.h 500 | @@ -408,7 +408,7 @@ extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer 501 | 502 | 503 | /* Normal cleanup handling, based on C cleanup attribute. */ 504 | -extern __inline void 505 | +__extern_inline void 506 | __libc_cleanup_routine (struct __pthread_cleanup_frame *f) 507 | { 508 | if (f->__do_it) 509 | diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h 510 | index f60ecdee18..4dc0b2272b 100644 511 | --- a/nptl/sysdeps/pthread/pthread.h 512 | +++ b/nptl/sysdeps/pthread/pthread.h 513 | @@ -572,7 +573,7 @@ class __pthread_cleanup_class 514 | function the compiler is free to decide inlining the change when 515 | needed or fall back on the copy which must exist somewhere 516 | else. */ 517 | -extern __inline void 518 | +__extern_inline void 519 | __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame) 520 | { 521 | if (__frame->__do_it) 522 | @@ -1103,7 +1104,7 @@ extern int pthread_atfork (void (*__prepare) (void), 523 | 524 | #ifdef __USE_EXTERN_INLINES 525 | /* Optimizations. */ 526 | -extern __inline int 527 | +__extern_inline int 528 | __NTH (pthread_equal (pthread_t __thread1, pthread_t __thread2)) 529 | { 530 | return __thread1 == __thread2; 531 | diff --git a/posix/bits/unistd.h b/posix/bits/unistd.h 532 | index b08aef2f6c..331e8ea3b9 100644 533 | --- a/posix/bits/unistd.h 534 | +++ b/posix/bits/unistd.h 535 | @@ -26,7 +26,7 @@ extern ssize_t __read_chk (int __fd, void *__buf, size_t __nbytes, 536 | extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf, 537 | size_t __nbytes), read) __wur; 538 | 539 | -extern __always_inline __wur ssize_t 540 | +__extern_always_inline __wur ssize_t 541 | read (int __fd, void *__buf, size_t __nbytes) 542 | { 543 | if (__bos0 (__buf) != (size_t) -1 544 | @@ -48,7 +48,7 @@ extern ssize_t __REDIRECT (__pread64_alias, 545 | __off64_t __offset), pread64) __wur; 546 | 547 | # ifndef __USE_FILE_OFFSET64 548 | -extern __always_inline __wur ssize_t 549 | +__extern_always_inline __wur ssize_t 550 | pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset) 551 | { 552 | if (__bos0 (__buf) != (size_t) -1 553 | @@ -57,7 +57,7 @@ pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset) 554 | return __pread_alias (__fd, __buf, __nbytes, __offset); 555 | } 556 | # else 557 | -extern __always_inline __wur ssize_t 558 | +__extern_always_inline __wur ssize_t 559 | pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) 560 | { 561 | if (__bos0 (__buf) != (size_t) -1 562 | @@ -68,7 +68,7 @@ pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) 563 | # endif 564 | 565 | # ifdef __USE_LARGEFILE64 566 | -extern __always_inline __wur ssize_t 567 | +__extern_always_inline __wur ssize_t 568 | pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) 569 | { 570 | if (__bos0 (__buf) != (size_t) -1 571 | @@ -89,7 +89,7 @@ extern ssize_t __REDIRECT_NTH (__readlink_alias, 572 | char *__restrict __buf, size_t __len), readlink) 573 | __nonnull ((1, 2)) __wur; 574 | 575 | -extern __always_inline __nonnull ((1, 2)) __wur ssize_t 576 | +__extern_always_inline __nonnull ((1, 2)) __wur ssize_t 577 | __NTH (readlink (__const char *__restrict __path, char *__restrict __buf, 578 | size_t __len)) 579 | { 580 | @@ -111,7 +111,7 @@ extern ssize_t __REDIRECT_NTH (__readlinkat_alias, 581 | readlinkat) 582 | __nonnull ((2, 3)) __wur; 583 | 584 | -extern __always_inline __nonnull ((2, 3)) __wur ssize_t 585 | +__extern_always_inline __nonnull ((2, 3)) __wur ssize_t 586 | __NTH (readlinkat (int __fd, __const char *__restrict __path, 587 | char *__restrict __buf, size_t __len)) 588 | { 589 | @@ -127,7 +127,7 @@ extern char *__getcwd_chk (char *__buf, size_t __size, size_t __buflen) 590 | extern char *__REDIRECT_NTH (__getcwd_alias, 591 | (char *__buf, size_t __size), getcwd) __wur; 592 | 593 | -extern __always_inline __wur char * 594 | +__extern_always_inline __wur char * 595 | __NTH (getcwd (char *__buf, size_t __size)) 596 | { 597 | if (__bos (__buf) != (size_t) -1 598 | @@ -142,7 +142,7 @@ extern char *__getwd_chk (char *__buf, size_t buflen) 599 | extern char *__REDIRECT_NTH (__getwd_alias, (char *__buf), getwd) 600 | __nonnull ((1)) __wur; 601 | 602 | -extern __always_inline __nonnull ((1)) __attribute_deprecated__ __wur char * 603 | +__extern_always_inline __nonnull ((1)) __attribute_deprecated__ __wur char * 604 | __NTH (getwd (char *__buf)) 605 | { 606 | if (__bos (__buf) != (size_t) -1) 607 | @@ -156,7 +156,7 @@ extern size_t __confstr_chk (int __name, char *__buf, size_t __len, 608 | extern size_t __REDIRECT_NTH (__confstr_alias, (int __name, char *__buf, 609 | size_t __len), confstr); 610 | 611 | -extern __always_inline size_t 612 | +__extern_always_inline size_t 613 | __NTH (confstr (int __name, char *__buf, size_t __len)) 614 | { 615 | if (__bos (__buf) != (size_t) -1 616 | @@ -171,7 +171,7 @@ extern int __getgroups_chk (int __size, __gid_t __list[], size_t listlen) 617 | extern int __REDIRECT_NTH (__getgroups_alias, (int __size, __gid_t __list[]), 618 | getgroups) __wur; 619 | 620 | -extern __always_inline int 621 | +__extern_always_inline int 622 | __NTH (getgroups (int __size, __gid_t __list[])) 623 | { 624 | if (__bos (__list) != (size_t) -1 625 | @@ -188,7 +188,7 @@ extern int __REDIRECT_NTH (__ttyname_r_alias, (int __fd, char *__buf, 626 | size_t __buflen), ttyname_r) 627 | __nonnull ((2)); 628 | 629 | -extern __always_inline int 630 | +__extern_always_inline int 631 | __NTH (ttyname_r (int __fd, char *__buf, size_t __buflen)) 632 | { 633 | if (__bos (__buf) != (size_t) -1 634 | @@ -204,7 +204,7 @@ extern int __getlogin_r_chk (char *__buf, size_t __buflen, size_t __nreal) 635 | extern int __REDIRECT (__getlogin_r_alias, (char *__buf, size_t __buflen), 636 | getlogin_r) __nonnull ((1)); 637 | 638 | -extern __always_inline int 639 | +__extern_always_inline int 640 | getlogin_r (char *__buf, size_t __buflen) 641 | { 642 | if (__bos (__buf) != (size_t) -1 643 | @@ -221,7 +221,7 @@ extern int __gethostname_chk (char *__buf, size_t __buflen, size_t __nreal) 644 | extern int __REDIRECT_NTH (__gethostname_alias, (char *__buf, size_t __buflen), 645 | gethostname) __nonnull ((1)); 646 | 647 | -extern __always_inline int 648 | +__extern_always_inline int 649 | __NTH (gethostname (char *__buf, size_t __buflen)) 650 | { 651 | if (__bos (__buf) != (size_t) -1 652 | @@ -239,7 +239,7 @@ extern int __REDIRECT_NTH (__getdomainname_alias, (char *__buf, 653 | size_t __buflen), 654 | getdomainname) __nonnull ((1)) __wur; 655 | 656 | -extern __always_inline int 657 | +__extern_always_inline int 658 | __NTH (getdomainname (char *__buf, size_t __buflen)) 659 | { 660 | if (__bos (__buf) != (size_t) -1 661 | diff --git a/socket/bits/socket2.h b/socket/bits/socket2.h 662 | index 2543ea37d4..9fac75669c 100644 663 | --- a/socket/bits/socket2.h 664 | +++ b/socket/bits/socket2.h 665 | @@ -26,7 +26,7 @@ extern ssize_t __recv_chk (int __fd, void *__buf, size_t __n, size_t __buflen, 666 | extern ssize_t __REDIRECT (__recv_alias, (int __fd, void *__buf, size_t __n, 667 | int __flags), recv); 668 | 669 | -extern __always_inline ssize_t 670 | +__extern_always_inline ssize_t 671 | recv (int __fd, void *__buf, size_t __n, int __flags) 672 | { 673 | if (__bos0 (__buf) != (size_t) -1 674 | @@ -44,7 +44,7 @@ extern ssize_t __REDIRECT (__recvfrom_alias, 675 | int __flags, __SOCKADDR_ARG __addr, 676 | socklen_t *__restrict __addr_len), recvfrom); 677 | 678 | -extern __always_inline ssize_t 679 | +__extern_always_inline ssize_t 680 | recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags, 681 | __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len) 682 | { 683 | diff --git a/stdlib/bits/stdlib.h b/stdlib/bits/stdlib.h 684 | index 4bacb09a09..7ee7bf5587 100644 685 | --- a/stdlib/bits/stdlib.h 686 | +++ b/stdlib/bits/stdlib.h 687 | @@ -28,7 +28,7 @@ extern char *__REDIRECT_NTH (__realpath_alias, 688 | (__const char *__restrict __name, 689 | char *__restrict __resolved), realpath) __wur; 690 | 691 | -extern __always_inline __wur char * 692 | +__extern_always_inline __wur char * 693 | __NTH (realpath (__const char *__restrict __name, char *__restrict __resolved)) 694 | { 695 | if (__bos (__resolved) != (size_t) -1) 696 | @@ -44,7 +44,7 @@ extern int __REDIRECT_NTH (__ptsname_r_alias, (int __fd, char *__buf, 697 | size_t __buflen), ptsname_r) 698 | __nonnull ((2)); 699 | 700 | -extern __always_inline int 701 | +__extern_always_inline int 702 | __NTH (ptsname_r (int __fd, char *__buf, size_t __buflen)) 703 | { 704 | if (__bos (__buf) != (size_t) -1 705 | @@ -59,7 +59,7 @@ extern int __wctomb_chk (char *__s, wchar_t __wchar, size_t __buflen) 706 | extern int __REDIRECT_NTH (__wctomb_alias, (char *__s, wchar_t __wchar), 707 | wctomb) __wur; 708 | 709 | -extern __always_inline __wur int 710 | +__extern_always_inline __wur int 711 | __NTH (wctomb (char *__s, wchar_t __wchar)) 712 | { 713 | /* We would have to include to get a definition of MB_LEN_MAX. 714 | @@ -83,7 +83,7 @@ extern size_t __REDIRECT_NTH (__mbstowcs_alias, 715 | __const char *__restrict __src, 716 | size_t __len), mbstowcs); 717 | 718 | -extern __always_inline size_t 719 | +__extern_always_inline size_t 720 | __NTH (mbstowcs (wchar_t *__restrict __dst, __const char *__restrict __src, 721 | size_t __len)) 722 | { 723 | @@ -104,7 +104,7 @@ extern size_t __REDIRECT_NTH (__wcstombs_alias, 724 | __const wchar_t *__restrict __src, 725 | size_t __len), wcstombs); 726 | 727 | -extern __always_inline size_t 728 | +__extern_always_inline size_t 729 | __NTH (wcstombs (char *__restrict __dst, __const wchar_t *__restrict __src, 730 | size_t __len)) 731 | { 732 | diff --git a/stdlib/gmp.h b/stdlib/gmp.h 733 | index 0ecc6d1024..cace8be230 100644 734 | --- a/stdlib/gmp.h 735 | +++ b/stdlib/gmp.h 736 | @@ -21,6 +21,8 @@ MA 02111-1307, USA. */ 737 | 738 | #ifndef __GMP_H__ 739 | 740 | +#include 741 | + 742 | #ifndef __GNU_MP__ 743 | #define __GNU_MP__ 2 744 | #define __need_size_t 745 | @@ -41,7 +43,7 @@ MA 02111-1307, USA. */ 746 | 747 | #ifndef _EXTERN_INLINE 748 | #ifdef __GNUC__ 749 | -#define _EXTERN_INLINE extern __inline__ 750 | +#define _EXTERN_INLINE __extern_inline 751 | #else 752 | #define _EXTERN_INLINE static 753 | #endif 754 | diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h 755 | index fd81cf9e5b..58fdbaf5be 100644 756 | --- a/stdlib/stdlib.h 757 | +++ b/stdlib/stdlib.h 758 | @@ -324,18 +324,18 @@ extern unsigned long long int __strtoull_internal (__const char * 759 | /* Define inline functions which call the internal entry points. */ 760 | 761 | __BEGIN_NAMESPACE_STD 762 | -extern __inline double 763 | +__extern_inline double 764 | __NTH (strtod (__const char *__restrict __nptr, char **__restrict __endptr)) 765 | { 766 | return __strtod_internal (__nptr, __endptr, 0); 767 | } 768 | -extern __inline long int 769 | +__extern_inline long int 770 | __NTH (strtol (__const char *__restrict __nptr, char **__restrict __endptr, 771 | int __base)) 772 | { 773 | return __strtol_internal (__nptr, __endptr, __base, 0); 774 | } 775 | -extern __inline unsigned long int 776 | +__extern_inline unsigned long int 777 | __NTH (strtoul (__const char *__restrict __nptr, char **__restrict __endptr, 778 | int __base)) 779 | { 780 | @@ -345,13 +345,13 @@ __END_NAMESPACE_STD 781 | 782 | # ifdef __USE_ISOC99 783 | __BEGIN_NAMESPACE_C99 784 | -extern __inline float 785 | +__extern_inline float 786 | __NTH (strtof (__const char *__restrict __nptr, char **__restrict __endptr)) 787 | { 788 | return __strtof_internal (__nptr, __endptr, 0); 789 | } 790 | # ifndef __LDBL_COMPAT 791 | -extern __inline long double 792 | +__extern_inline long double 793 | __NTH (strtold (__const char *__restrict __nptr, char **__restrict __endptr)) 794 | { 795 | return __strtold_internal (__nptr, __endptr, 0); 796 | @@ -361,13 +361,13 @@ __END_NAMESPACE_C99 797 | # endif 798 | 799 | # ifdef __USE_BSD 800 | -__extension__ extern __inline long long int 801 | +__extension__ __extern_inline long long int 802 | __NTH (strtoq (__const char *__restrict __nptr, char **__restrict __endptr, 803 | int __base)) 804 | { 805 | return __strtoll_internal (__nptr, __endptr, __base, 0); 806 | } 807 | -__extension__ extern __inline unsigned long long int 808 | +__extension__ __extern_inline unsigned long long int 809 | __NTH (strtouq (__const char *__restrict __nptr, char **__restrict __endptr, 810 | int __base)) 811 | { 812 | @@ -377,13 +377,13 @@ __NTH (strtouq (__const char *__restrict __nptr, char **__restrict __endptr, 813 | 814 | # if defined __USE_MISC || defined __USE_ISOC99 815 | __BEGIN_NAMESPACE_C99 816 | -__extension__ extern __inline long long int 817 | +__extension__ __extern_inline long long int 818 | __NTH (strtoll (__const char *__restrict __nptr, char **__restrict __endptr, 819 | int __base)) 820 | { 821 | return __strtoll_internal (__nptr, __endptr, __base, 0); 822 | } 823 | -__extension__ extern __inline unsigned long long int 824 | +__extension__ __extern_inline unsigned long long int 825 | __NTH (strtoull (__const char * __restrict __nptr, char **__restrict __endptr, 826 | int __base)) 827 | { 828 | @@ -393,17 +393,17 @@ __END_NAMESPACE_C99 829 | # endif 830 | 831 | __BEGIN_NAMESPACE_STD 832 | -extern __inline double 833 | +__extern_inline double 834 | __NTH (atof (__const char *__nptr)) 835 | { 836 | return strtod (__nptr, (char **) NULL); 837 | } 838 | -extern __inline int 839 | +__extern_inline int 840 | __NTH (atoi (__const char *__nptr)) 841 | { 842 | return (int) strtol (__nptr, (char **) NULL, 10); 843 | } 844 | -extern __inline long int 845 | +__extern_inline long int 846 | __NTH (atol (__const char *__nptr)) 847 | { 848 | return strtol (__nptr, (char **) NULL, 10); 849 | @@ -412,7 +412,7 @@ __END_NAMESPACE_STD 850 | 851 | # if defined __USE_MISC || defined __USE_ISOC99 852 | __BEGIN_NAMESPACE_C99 853 | -__extension__ extern __inline long long int 854 | +__extension__ __extern_inline long long int 855 | __NTH (atoll (__const char *__nptr)) 856 | { 857 | return strtoll (__nptr, (char **) NULL, 10); 858 | diff --git a/string/argz.h b/string/argz.h 859 | index dd7e4706c7..4141d998f9 100644 860 | --- a/string/argz.h 861 | +++ b/string/argz.h 862 | @@ -160,7 +160,7 @@ extern char *argz_next (__const char *__restrict __argz, size_t __argz_len, 863 | __const char *__restrict __entry) __THROW; 864 | 865 | #ifdef __USE_EXTERN_INLINES 866 | -extern inline char * 867 | +__extern_inline char * 868 | __NTH (__argz_next (__const char *__argz, size_t __argz_len, 869 | __const char *__entry)) 870 | { 871 | @@ -174,7 +174,7 @@ __NTH (__argz_next (__const char *__argz, size_t __argz_len, 872 | else 873 | return __argz_len > 0 ? (char *) __argz : 0; 874 | } 875 | -extern inline char * 876 | +__extern_inline char * 877 | __NTH (argz_next (__const char *__argz, size_t __argz_len, 878 | __const char *__entry)) 879 | { 880 | diff --git a/string/bits/string2.h b/string/bits/string2.h 881 | index ba84da2346..1e4d736a17 100644 882 | --- a/string/bits/string2.h 883 | +++ b/string/bits/string2.h 884 | @@ -43,7 +43,7 @@ 885 | # ifdef __cplusplus 886 | # define __STRING_INLINE inline 887 | # else 888 | -# define __STRING_INLINE extern __inline 889 | +# define __STRING_INLINE __extern_inline 890 | # endif 891 | #endif 892 | 893 | diff --git a/string/bits/string3.h b/string/bits/string3.h 894 | index 041ac11259..f68ce5899f 100644 895 | --- a/string/bits/string3.h 896 | +++ b/string/bits/string3.h 897 | @@ -151,7 +151,7 @@ extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, 898 | __const char *__src, 899 | size_t __n), stpncpy); 900 | 901 | -extern __always_inline char * 902 | +__extern_always_inline char * 903 | __NTH (stpncpy (char *__dest, __const char *__src, size_t __n)) 904 | { 905 | if (__bos (__dest) != (size_t) -1 906 | diff --git a/sysdeps/alpha/fpu/bits/mathinline.h b/sysdeps/alpha/fpu/bits/mathinline.h 907 | index 87d40058c3..99fee717c8 100644 908 | --- a/sysdeps/alpha/fpu/bits/mathinline.h 909 | +++ b/sysdeps/alpha/fpu/bits/mathinline.h 910 | @@ -25,7 +25,7 @@ 911 | #ifdef __cplusplus 912 | # define __MATH_INLINE __inline 913 | #else 914 | -# define __MATH_INLINE extern __inline 915 | +# define __MATH_INLINE __extern_inline 916 | #endif 917 | 918 | #if defined __USE_ISOC99 && defined __GNUC__ && !__GNUC_PREREQ(3,0) 919 | diff --git a/sysdeps/generic/inttypes.h b/sysdeps/generic/inttypes.h 920 | index 87f532f1d4..3f1b316c09 100644 921 | --- a/sysdeps/generic/inttypes.h 922 | +++ b/sysdeps/generic/inttypes.h 923 | @@ -330,7 +330,7 @@ extern long int __strtol_internal (__const char *__restrict __nptr, 924 | int __base, int __group) __THROW; 925 | # define __strtol_internal_defined 1 926 | # endif 927 | -extern __inline intmax_t 928 | +__extern_inline intmax_t 929 | __NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr, 930 | int base)) 931 | { 932 | @@ -345,7 +345,7 @@ extern unsigned long int __strtoul_internal (__const char * 933 | int __base, int __group) __THROW; 934 | # define __strtoul_internal_defined 1 935 | # endif 936 | -extern __inline uintmax_t 937 | +__extern_inline uintmax_t 938 | __NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr, 939 | int base)) 940 | { 941 | @@ -359,7 +359,7 @@ extern long int __wcstol_internal (__const __gwchar_t * __restrict __nptr, 942 | int __base, int __group) __THROW; 943 | # define __wcstol_internal_defined 1 944 | # endif 945 | -extern __inline intmax_t 946 | +__extern_inline intmax_t 947 | __NTH (wcstoimax (__const __gwchar_t *__restrict nptr, 948 | __gwchar_t **__restrict endptr, int base)) 949 | { 950 | @@ -376,7 +376,7 @@ extern unsigned long int __wcstoul_internal (__const __gwchar_t * 951 | int __base, int __group) __THROW; 952 | # define __wcstoul_internal_defined 1 953 | # endif 954 | -extern __inline uintmax_t 955 | +__extern_inline uintmax_t 956 | __NTH (wcstoumax (__const __gwchar_t *__restrict nptr, 957 | __gwchar_t **__restrict endptr, int base)) 958 | { 959 | @@ -393,7 +393,7 @@ extern long long int __strtoll_internal (__const char *__restrict __nptr, 960 | int __base, int __group) __THROW; 961 | # define __strtoll_internal_defined 1 962 | # endif 963 | -extern __inline intmax_t 964 | +__extern_inline intmax_t 965 | __NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr, 966 | int base)) 967 | { 968 | @@ -411,7 +411,7 @@ extern unsigned long long int __strtoull_internal (__const char * 969 | int __group) __THROW; 970 | # define __strtoull_internal_defined 1 971 | # endif 972 | -extern __inline uintmax_t 973 | +__extern_inline uintmax_t 974 | __NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr, 975 | int base)) 976 | { 977 | @@ -427,7 +427,7 @@ extern long long int __wcstoll_internal (__const __gwchar_t * 978 | int __base, int __group) __THROW; 979 | # define __wcstoll_internal_defined 1 980 | # endif 981 | -extern __inline intmax_t 982 | +__extern_inline intmax_t 983 | __NTH (wcstoimax (__const __gwchar_t *__restrict nptr, 984 | __gwchar_t **__restrict endptr, int base)) 985 | { 986 | @@ -446,7 +446,7 @@ extern unsigned long long int __wcstoull_internal (__const __gwchar_t * 987 | int __group) __THROW; 988 | # define __wcstoull_internal_defined 1 989 | # endif 990 | -extern __inline uintmax_t 991 | +__extern_inline uintmax_t 992 | __NTH (wcstoumax (__const __gwchar_t *__restrict nptr, 993 | __gwchar_t **__restrict endptr, int base)) 994 | { 995 | diff --git a/sysdeps/generic/machine-lock.h b/sysdeps/generic/machine-lock.h 996 | index c7cadf5128..db9f444891 100644 997 | --- a/sysdeps/generic/machine-lock.h 998 | +++ b/sysdeps/generic/machine-lock.h 999 | @@ -30,7 +30,7 @@ typedef volatile int __spin_lock_t; 1000 | 1001 | 1002 | #ifndef _EXTERN_INLINE 1003 | -#define _EXTERN_INLINE extern __inline 1004 | +#define _EXTERN_INLINE __extern_inline 1005 | #endif 1006 | 1007 | /* Unlock LOCK. */ 1008 | diff --git a/sysdeps/generic/machine-sp.h b/sysdeps/generic/machine-sp.h 1009 | index a8be7c0f69..25e423efa5 100644 1010 | --- a/sysdeps/generic/machine-sp.h 1011 | +++ b/sysdeps/generic/machine-sp.h 1012 | @@ -23,7 +23,7 @@ 1013 | /* Return the current stack pointer. */ 1014 | 1015 | #ifndef _EXTERN_INLINE 1016 | -#define _EXTERN_INLINE extern __inline 1017 | +#define _EXTERN_INLINE __extern_inline 1018 | #endif 1019 | 1020 | _EXTERN_INLINE void * 1021 | diff --git a/sysdeps/i386/fpu/bits/mathinline.h b/sysdeps/i386/fpu/bits/mathinline.h 1022 | index 28547d44b8..a0f630e240 100644 1023 | --- a/sysdeps/i386/fpu/bits/mathinline.h 1024 | +++ b/sysdeps/i386/fpu/bits/mathinline.h 1025 | @@ -26,7 +26,7 @@ 1026 | #ifdef __cplusplus 1027 | # define __MATH_INLINE __inline 1028 | #else 1029 | -# define __MATH_INLINE extern __inline 1030 | +# define __MATH_INLINE __extern_inline 1031 | #endif 1032 | 1033 | 1034 | diff --git a/sysdeps/i386/i486/bits/string.h b/sysdeps/i386/i486/bits/string.h 1035 | index 203907b146..2db9abc9e4 100644 1036 | --- a/sysdeps/i386/i486/bits/string.h 1037 | +++ b/sysdeps/i386/i486/bits/string.h 1038 | @@ -35,7 +35,7 @@ 1039 | # ifdef __cplusplus 1040 | # define __STRING_INLINE inline 1041 | # else 1042 | -# define __STRING_INLINE extern __inline 1043 | +# define __STRING_INLINE __extern_inline 1044 | # endif 1045 | #endif 1046 | 1047 | diff --git a/sysdeps/ia64/fpu/bits/mathinline.h b/sysdeps/ia64/fpu/bits/mathinline.h 1048 | index 9bb5f1a710..1e90257182 100644 1049 | --- a/sysdeps/ia64/fpu/bits/mathinline.h 1050 | +++ b/sysdeps/ia64/fpu/bits/mathinline.h 1051 | @@ -24,7 +24,7 @@ 1052 | #ifdef __cplusplus 1053 | # define __MATH_INLINE __inline 1054 | #else 1055 | -# define __MATH_INLINE extern __inline 1056 | +# define __MATH_INLINE __extern_inline 1057 | #endif 1058 | 1059 | #if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2 1060 | diff --git a/sysdeps/mach/alpha/machine-lock.h b/sysdeps/mach/alpha/machine-lock.h 1061 | index 80f8750c87..bd27d2a51f 100644 1062 | --- a/sysdeps/mach/alpha/machine-lock.h 1063 | +++ b/sysdeps/mach/alpha/machine-lock.h 1064 | @@ -30,7 +30,7 @@ typedef __volatile long int __spin_lock_t; 1065 | 1066 | 1067 | #ifndef _EXTERN_INLINE 1068 | -#define _EXTERN_INLINE extern __inline 1069 | +#define _EXTERN_INLINE __extern_inline 1070 | #endif 1071 | 1072 | /* Unlock LOCK. */ 1073 | diff --git a/sysdeps/mach/alpha/machine-sp.h b/sysdeps/mach/alpha/machine-sp.h 1074 | index b737525574..e6df63c9ac 100644 1075 | --- a/sysdeps/mach/alpha/machine-sp.h 1076 | +++ b/sysdeps/mach/alpha/machine-sp.h 1077 | @@ -23,7 +23,7 @@ 1078 | /* Return the current stack pointer. */ 1079 | 1080 | #ifndef _EXTERN_INLINE 1081 | -#define _EXTERN_INLINE extern __inline 1082 | +#define _EXTERN_INLINE __extern_inline 1083 | #endif 1084 | 1085 | _EXTERN_INLINE void * 1086 | diff --git a/sysdeps/mach/i386/machine-lock.h b/sysdeps/mach/i386/machine-lock.h 1087 | index 7c23fba8c5..d786628170 100644 1088 | --- a/sysdeps/mach/i386/machine-lock.h 1089 | +++ b/sysdeps/mach/i386/machine-lock.h 1090 | @@ -30,7 +30,7 @@ typedef __volatile int __spin_lock_t; 1091 | 1092 | 1093 | #ifndef _EXTERN_INLINE 1094 | -#define _EXTERN_INLINE extern __inline 1095 | +#define _EXTERN_INLINE __extern_inline 1096 | #endif 1097 | 1098 | /* Unlock LOCK. */ 1099 | diff --git a/sysdeps/mach/powerpc/machine-lock.h b/sysdeps/mach/powerpc/machine-lock.h 1100 | index cba6b0a6e2..96af2219be 100644 1101 | --- a/sysdeps/mach/powerpc/machine-lock.h 1102 | +++ b/sysdeps/mach/powerpc/machine-lock.h 1103 | @@ -30,7 +30,7 @@ typedef __volatile long int __spin_lock_t; 1104 | 1105 | 1106 | #ifndef _EXTERN_INLINE 1107 | -#define _EXTERN_INLINE extern __inline 1108 | +#define _EXTERN_INLINE __extern_inline 1109 | #endif 1110 | 1111 | /* Unlock LOCK. */ 1112 | diff --git a/sysdeps/mach/powerpc/machine-sp.h b/sysdeps/mach/powerpc/machine-sp.h 1113 | index cf5341cb9b..267707bce0 100644 1114 | --- a/sysdeps/mach/powerpc/machine-sp.h 1115 | +++ b/sysdeps/mach/powerpc/machine-sp.h 1116 | @@ -27,7 +27,7 @@ 1117 | # ifdef _HURD_THREADVAR_H_EXTERN_INLINE 1118 | # define _EXTERN_INLINE _HURD_THREADVAR_H_EXTERN_INLINE 1119 | # else 1120 | -# define _EXTERN_INLINE extern __inline 1121 | +# define _EXTERN_INLINE __extern_inline 1122 | # endif 1123 | #endif 1124 | 1125 | diff --git a/sysdeps/powerpc/fpu/bits/mathinline.h b/sysdeps/powerpc/fpu/bits/mathinline.h 1126 | index aed899e882..b2c3f6ab09 100644 1127 | --- a/sysdeps/powerpc/fpu/bits/mathinline.h 1128 | +++ b/sysdeps/powerpc/fpu/bits/mathinline.h 1129 | @@ -25,7 +25,7 @@ 1130 | #ifdef __cplusplus 1131 | # define __MATH_INLINE __inline 1132 | #else 1133 | -# define __MATH_INLINE extern __inline 1134 | +# define __MATH_INLINE __extern_inline 1135 | #endif /* __cplusplus */ 1136 | 1137 | #if defined __GNUC__ && !defined _SOFT_FLOAT 1138 | diff --git a/sysdeps/s390/bits/string.h b/sysdeps/s390/bits/string.h 1139 | index d83df39bb2..e16c7cb829 100644 1140 | --- a/sysdeps/s390/bits/string.h 1141 | +++ b/sysdeps/s390/bits/string.h 1142 | @@ -34,7 +34,7 @@ 1143 | # ifdef __cplusplus 1144 | # define __STRING_INLINE inline 1145 | # else 1146 | -# define __STRING_INLINE extern __inline 1147 | +# define __STRING_INLINE __extern_inline 1148 | # endif 1149 | #endif 1150 | 1151 | diff --git a/sysdeps/s390/fpu/bits/mathinline.h b/sysdeps/s390/fpu/bits/mathinline.h 1152 | index 5c6b83ad06..06a6368450 100644 1153 | --- a/sysdeps/s390/fpu/bits/mathinline.h 1154 | +++ b/sysdeps/s390/fpu/bits/mathinline.h 1155 | @@ -24,7 +24,7 @@ 1156 | #ifdef __cplusplus 1157 | # define __MATH_INLINE __inline 1158 | #else 1159 | -# define __MATH_INLINE extern __inline 1160 | +# define __MATH_INLINE __extern_inline 1161 | #endif 1162 | 1163 | #if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \ 1164 | diff --git a/sysdeps/sparc/fpu/bits/mathinline.h b/sysdeps/sparc/fpu/bits/mathinline.h 1165 | index 9dd784d122..16ad22e666 100644 1166 | --- a/sysdeps/sparc/fpu/bits/mathinline.h 1167 | +++ b/sysdeps/sparc/fpu/bits/mathinline.h 1168 | @@ -131,7 +131,7 @@ 1169 | # ifdef __cplusplus 1170 | # define __MATH_INLINE __inline 1171 | # else 1172 | -# define __MATH_INLINE extern __inline 1173 | +# define __MATH_INLINE __extern_inline 1174 | # endif /* __cplusplus */ 1175 | 1176 | /* The gcc, version 2.7 or below, has problems with all this inlining 1177 | diff --git a/sysdeps/unix/bsd/bsd4.4/bits/socket.h b/sysdeps/unix/bsd/bsd4.4/bits/socket.h 1178 | index b2227f10d2..f74603f948 100644 1179 | --- a/sysdeps/unix/bsd/bsd4.4/bits/socket.h 1180 | +++ b/sysdeps/unix/bsd/bsd4.4/bits/socket.h 1181 | @@ -227,7 +227,7 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr, 1182 | struct cmsghdr *__cmsg) __THROW; 1183 | #ifdef __USE_EXTERN_INLINES 1184 | # ifndef _EXTERN_INLINE 1185 | -# define _EXTERN_INLINE extern __inline 1186 | +# define _EXTERN_INLINE __extern_inline 1187 | # endif 1188 | _EXTERN_INLINE struct cmsghdr * 1189 | __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)) 1190 | diff --git a/sysdeps/unix/sysv/linux/bits/sigset.h b/sysdeps/unix/sysv/linux/bits/sigset.h 1191 | index 7ccadda456..daec8ac494 100644 1192 | --- a/sysdeps/unix/sysv/linux/bits/sigset.h 1193 | +++ b/sysdeps/unix/sysv/linux/bits/sigset.h 1194 | @@ -43,7 +44,7 @@ typedef struct 1195 | # define _SIGSET_H_fns 1 1196 | 1197 | # ifndef _EXTERN_INLINE 1198 | -# define _EXTERN_INLINE extern __inline 1199 | +# define _EXTERN_INLINE __extern_inline 1200 | # endif 1201 | 1202 | /* Return a mask that includes the bit for SIG only. */ 1203 | diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h 1204 | index 356a2ece74..377f589bbd 100644 1205 | --- a/sysdeps/unix/sysv/linux/bits/socket.h 1206 | +++ b/sysdeps/unix/sysv/linux/bits/socket.h 1207 | @@ -264,7 +265,7 @@ extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr, 1208 | struct cmsghdr *__cmsg) __THROW; 1209 | #ifdef __USE_EXTERN_INLINES 1210 | # ifndef _EXTERN_INLINE 1211 | -# define _EXTERN_INLINE extern __inline 1212 | +# define _EXTERN_INLINE __extern_inline 1213 | # endif 1214 | _EXTERN_INLINE struct cmsghdr * 1215 | __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)) 1216 | diff --git a/sysdeps/unix/sysv/linux/sys/sysmacros.h b/sysdeps/unix/sysv/linux/sys/sysmacros.h 1217 | index 179642ff40..e59672980e 100644 1218 | --- a/sysdeps/unix/sysv/linux/sys/sysmacros.h 1219 | +++ b/sysdeps/unix/sysv/linux/sys/sysmacros.h 1220 | @@ -27,30 +28,30 @@ 1221 | they need. */ 1222 | #ifdef __GLIBC_HAVE_LONG_LONG 1223 | __extension__ 1224 | -extern __inline unsigned int gnu_dev_major (unsigned long long int __dev) 1225 | +__extern_inline unsigned int gnu_dev_major (unsigned long long int __dev) 1226 | __THROW; 1227 | __extension__ 1228 | -extern __inline unsigned int gnu_dev_minor (unsigned long long int __dev) 1229 | +__extern_inline unsigned int gnu_dev_minor (unsigned long long int __dev) 1230 | __THROW; 1231 | __extension__ 1232 | -extern __inline unsigned long long int gnu_dev_makedev (unsigned int __major, 1233 | +__extern_inline unsigned long long int gnu_dev_makedev (unsigned int __major, 1234 | unsigned int __minor) 1235 | __THROW; 1236 | 1237 | # if defined __GNUC__ && __GNUC__ >= 2 1238 | -__extension__ extern __inline unsigned int 1239 | +__extension__ __extern_inline unsigned int 1240 | __NTH (gnu_dev_major (unsigned long long int __dev)) 1241 | { 1242 | return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff); 1243 | } 1244 | 1245 | -__extension__ extern __inline unsigned int 1246 | +__extension__ __extern_inline unsigned int 1247 | __NTH (gnu_dev_minor (unsigned long long int __dev)) 1248 | { 1249 | return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); 1250 | } 1251 | 1252 | -__extension__ extern __inline unsigned long long int 1253 | +__extension__ __extern_inline unsigned long long int 1254 | __NTH (gnu_dev_makedev (unsigned int __major, unsigned int __minor)) 1255 | { 1256 | return ((__minor & 0xff) | ((__major & 0xfff) << 8) 1257 | diff --git a/sysdeps/x86_64/fpu/bits/mathinline.h b/sysdeps/x86_64/fpu/bits/mathinline.h 1258 | index 39d11b678d..d08a9b033b 100644 1259 | --- a/sysdeps/x86_64/fpu/bits/mathinline.h 1260 | +++ b/sysdeps/x86_64/fpu/bits/mathinline.h 1261 | @@ -25,7 +25,7 @@ 1262 | #ifdef __cplusplus 1263 | # define __MATH_INLINE __inline 1264 | #else 1265 | -# define __MATH_INLINE extern __inline 1266 | +# define __MATH_INLINE __extern_inline 1267 | #endif 1268 | 1269 | 1270 | diff --git a/wcsmbs/bits/wchar2.h b/wcsmbs/bits/wchar2.h 1271 | index 00216ec059..697b9f2cd8 100644 1272 | --- a/wcsmbs/bits/wchar2.h 1273 | +++ b/wcsmbs/bits/wchar2.h 1274 | @@ -30,7 +30,7 @@ extern wchar_t *__REDIRECT_NTH (__wmemcpy_alias, 1275 | __const wchar_t *__restrict __s2, size_t __n), 1276 | wmemcpy); 1277 | 1278 | -extern __always_inline wchar_t * 1279 | +__extern_always_inline wchar_t * 1280 | __NTH (wmemcpy (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, 1281 | size_t __n)) 1282 | { 1283 | @@ -46,7 +46,7 @@ extern wchar_t *__REDIRECT_NTH (__wmemmove_alias, (wchar_t *__s1, 1284 | __const wchar_t *__s2, 1285 | size_t __n), wmemmove); 1286 | 1287 | -extern __always_inline wchar_t * 1288 | +__extern_always_inline wchar_t * 1289 | __NTH (wmemmove (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, 1290 | size_t __n)) 1291 | { 1292 | @@ -65,7 +65,7 @@ extern wchar_t *__REDIRECT_NTH (__wmempcpy_alias, 1293 | __const wchar_t *__restrict __s2, 1294 | size_t __n), wmempcpy); 1295 | 1296 | -extern __always_inline wchar_t * 1297 | +__extern_always_inline wchar_t * 1298 | __NTH (wmempcpy (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2, 1299 | size_t __n)) 1300 | { 1301 | @@ -81,7 +81,7 @@ extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n, 1302 | extern wchar_t *__REDIRECT_NTH (__wmemset_alias, (wchar_t *__s, wchar_t __c, 1303 | size_t __n), wmemset); 1304 | 1305 | -extern __always_inline wchar_t * 1306 | +__extern_always_inline wchar_t * 1307 | __NTH (wmemset (wchar_t *__restrict __s, wchar_t __c, size_t __n)) 1308 | { 1309 | if (__bos0 (__s) != (size_t) -1) 1310 | @@ -97,7 +97,7 @@ extern wchar_t *__REDIRECT_NTH (__wcscpy_alias, 1311 | (wchar_t *__restrict __dest, 1312 | __const wchar_t *__restrict __src), wcscpy); 1313 | 1314 | -extern __always_inline wchar_t * 1315 | +__extern_always_inline wchar_t * 1316 | __NTH (wcscpy (wchar_t *__dest, __const wchar_t *__src)) 1317 | { 1318 | if (__bos (__dest) != (size_t) -1) 1319 | @@ -112,7 +112,7 @@ extern wchar_t *__REDIRECT_NTH (__wcpcpy_alias, (wchar_t *__dest, 1320 | __const wchar_t *__src), 1321 | wcpcpy); 1322 | 1323 | -extern __always_inline wchar_t * 1324 | +__extern_always_inline wchar_t * 1325 | __NTH (wcpcpy (wchar_t *__dest, __const wchar_t *__src)) 1326 | { 1327 | if (__bos (__dest) != (size_t) -1) 1328 | @@ -129,7 +129,7 @@ extern wchar_t *__REDIRECT_NTH (__wcsncpy_alias, 1329 | __const wchar_t *__restrict __src, 1330 | size_t __n), wcsncpy); 1331 | 1332 | -extern __always_inline wchar_t * 1333 | +__extern_always_inline wchar_t * 1334 | __NTH (wcsncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n)) 1335 | { 1336 | if (__bos (__dest) != (size_t) -1 1337 | @@ -148,7 +148,7 @@ extern wchar_t *__REDIRECT_NTH (__wcpncpy_alias, 1338 | __const wchar_t *__restrict __src, 1339 | size_t __n), wcpncpy); 1340 | 1341 | -extern __always_inline wchar_t * 1342 | +__extern_always_inline wchar_t * 1343 | __NTH (wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n)) 1344 | { 1345 | if (__bos (__dest) != (size_t) -1 1346 | @@ -166,7 +166,7 @@ extern wchar_t *__REDIRECT_NTH (__wcscat_alias, 1347 | (wchar_t *__restrict __dest, 1348 | __const wchar_t *__restrict __src), wcscat); 1349 | 1350 | -extern __always_inline wchar_t * 1351 | +__extern_always_inline wchar_t * 1352 | __NTH (wcscat (wchar_t *__dest, __const wchar_t *__src)) 1353 | { 1354 | if (__bos (__dest) != (size_t) -1) 1355 | @@ -183,7 +183,7 @@ extern wchar_t *__REDIRECT_NTH (__wcsncat_alias, 1356 | __const wchar_t *__restrict __src, 1357 | size_t __n), wcsncat); 1358 | 1359 | -extern __always_inline wchar_t * 1360 | +__extern_always_inline wchar_t * 1361 | __NTH (wcsncat (wchar_t *__dest, __const wchar_t *__src, size_t __n)) 1362 | { 1363 | if (__bos (__dest) != (size_t) -1) 1364 | @@ -246,7 +246,7 @@ extern wchar_t *__REDIRECT (__fgetws_alias, 1365 | (wchar_t *__restrict __s, int __n, 1366 | __FILE *__restrict __stream), fgetws) __wur; 1367 | 1368 | -extern __always_inline __wur wchar_t * 1369 | +__extern_always_inline __wur wchar_t * 1370 | fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream) 1371 | { 1372 | if (__bos (__s) != (size_t) -1 1373 | @@ -264,7 +264,7 @@ extern wchar_t *__REDIRECT (__fgetws_unlocked_alias, 1374 | __FILE *__restrict __stream), fgetws_unlocked) 1375 | __wur; 1376 | 1377 | -extern __always_inline __wur wchar_t * 1378 | +__extern_always_inline __wur wchar_t * 1379 | fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream) 1380 | { 1381 | if (__bos (__s) != (size_t) -1 1382 | @@ -281,7 +281,7 @@ extern size_t __REDIRECT_NTH (__wcrtomb_alias, 1383 | (char *__restrict __s, wchar_t __wchar, 1384 | mbstate_t *__restrict __ps), wcrtomb) __wur; 1385 | 1386 | -extern __always_inline __wur size_t 1387 | +__extern_always_inline __wur size_t 1388 | __NTH (wcrtomb (char *__s, wchar_t __wchar, mbstate_t *__ps)) 1389 | { 1390 | /* We would have to include to get a definition of MB_LEN_MAX. 1391 | @@ -307,7 +307,7 @@ extern size_t __REDIRECT_NTH (__mbsrtowcs_alias, 1392 | size_t __len, mbstate_t *__restrict __ps), 1393 | mbsrtowcs); 1394 | 1395 | -extern __always_inline size_t 1396 | +__extern_always_inline size_t 1397 | __NTH (mbsrtowcs (wchar_t *__restrict __dst, __const char **__restrict __src, 1398 | size_t __len, mbstate_t *__restrict __ps)) 1399 | { 1400 | @@ -330,7 +330,7 @@ extern size_t __REDIRECT_NTH (__wcsrtombs_alias, 1401 | size_t __len, mbstate_t *__restrict __ps), 1402 | wcsrtombs); 1403 | 1404 | -extern __always_inline size_t 1405 | +__extern_always_inline size_t 1406 | __NTH (wcsrtombs (char *__restrict __dst, __const wchar_t **__restrict __src, 1407 | size_t __len, mbstate_t *__restrict __ps)) 1408 | { 1409 | @@ -352,7 +352,7 @@ extern size_t __REDIRECT_NTH (__mbsnrtowcs_alias, 1410 | size_t __len, mbstate_t *__restrict __ps), 1411 | mbsnrtowcs); 1412 | 1413 | -extern __always_inline size_t 1414 | +__extern_always_inline size_t 1415 | __NTH (mbsnrtowcs (wchar_t *__restrict __dst, __const char **__restrict __src, 1416 | size_t __nmc, size_t __len, mbstate_t *__restrict __ps)) 1417 | { 1418 | @@ -376,7 +376,7 @@ extern size_t __REDIRECT_NTH (__wcsnrtombs_alias, 1419 | size_t __nwc, size_t __len, 1420 | mbstate_t *__restrict __ps), wcsnrtombs); 1421 | 1422 | -extern __always_inline size_t 1423 | +__extern_always_inline size_t 1424 | __NTH (wcsnrtombs (char *__restrict __dst, __const wchar_t **__restrict __src, 1425 | size_t __nwc, size_t __len, mbstate_t *__restrict __ps)) 1426 | { 1427 | diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h 1428 | index f54abfaa96..7c43b24274 100644 1429 | --- a/wcsmbs/wchar.h 1430 | +++ b/wcsmbs/wchar.h 1431 | @@ -326,19 +326,19 @@ __END_NAMESPACE_C99 1432 | locales must use ASCII encoding for the values in the ASCII range 1433 | and because the wchar_t encoding is always ISO 10646. */ 1434 | extern wint_t __btowc_alias (int __c) __asm ("btowc"); 1435 | -extern __inline wint_t 1436 | +__extern_inline wint_t 1437 | __NTH (btowc (int __c)) 1438 | { return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f' 1439 | ? (wint_t) __c : __btowc_alias (__c)); } 1440 | 1441 | extern int __wctob_alias (wint_t __c) __asm ("wctob"); 1442 | -extern __inline int 1443 | +__extern_inline int 1444 | __NTH (wctob (wint_t __wc)) 1445 | { return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f' 1446 | ? (int) __wc : __wctob_alias (__wc)); } 1447 | # endif 1448 | 1449 | -extern __inline size_t 1450 | +__extern_inline size_t 1451 | __NTH (mbrlen (__const char *__restrict __s, size_t __n, 1452 | mbstate_t *__restrict __ps)) 1453 | { return (__ps != NULL 1454 | @@ -548,38 +548,38 @@ extern unsigned long long int __wcstoull_internal (__const wchar_t * 1455 | /* Define inline functions which call the internal entry points. */ 1456 | __BEGIN_NAMESPACE_C99 1457 | 1458 | -extern __inline double 1459 | +__extern_inline double 1460 | __NTH (wcstod (__const wchar_t *__restrict __nptr, 1461 | wchar_t **__restrict __endptr)) 1462 | { return __wcstod_internal (__nptr, __endptr, 0); } 1463 | -extern __inline long int 1464 | +__extern_inline long int 1465 | __NTH (wcstol (__const wchar_t *__restrict __nptr, 1466 | wchar_t **__restrict __endptr, int __base)) 1467 | { return __wcstol_internal (__nptr, __endptr, __base, 0); } 1468 | -extern __inline unsigned long int 1469 | +__extern_inline unsigned long int 1470 | __NTH (wcstoul (__const wchar_t *__restrict __nptr, 1471 | wchar_t **__restrict __endptr, int __base)) 1472 | { return __wcstoul_internal (__nptr, __endptr, __base, 0); } 1473 | __END_NAMESPACE_C99 1474 | 1475 | # ifdef __USE_GNU 1476 | -extern __inline float 1477 | +__extern_inline float 1478 | __NTH (wcstof (__const wchar_t *__restrict __nptr, 1479 | wchar_t **__restrict __endptr)) 1480 | { return __wcstof_internal (__nptr, __endptr, 0); } 1481 | # ifndef __LDBL_COMPAT 1482 | -extern __inline long double 1483 | +__extern_inline long double 1484 | __NTH (wcstold (__const wchar_t *__restrict __nptr, 1485 | wchar_t **__restrict __endptr)) 1486 | { return __wcstold_internal (__nptr, __endptr, 0); } 1487 | # endif 1488 | __extension__ 1489 | -extern __inline long long int 1490 | +__extern_inline long long int 1491 | __NTH (wcstoq (__const wchar_t *__restrict __nptr, 1492 | wchar_t **__restrict __endptr, int __base)) 1493 | { return __wcstoll_internal (__nptr, __endptr, __base, 0); } 1494 | __extension__ 1495 | -extern __inline unsigned long long int 1496 | +__extern_inline unsigned long long int 1497 | __NTH (wcstouq (__const wchar_t *__restrict __nptr, 1498 | wchar_t **__restrict __endptr, int __base)) 1499 | { return __wcstoull_internal (__nptr, __endptr, __base, 0); } 1500 | -------------------------------------------------------------------------------- /patches/fix_bad_version_checks.diff: -------------------------------------------------------------------------------- 1 | diff --git a/configure b/configure 2 | index 999a448a05..76123f7926 100755 3 | --- a/configure 4 | +++ b/configure 5 | @@ -5049,9 +5049,9 @@ $as_echo_n "checking version of $CC... " >&6; } 6 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5 7 | $as_echo "$ac_prog_version" >&6; } 8 | fi 9 | -if test $ac_verc_fail = yes; then 10 | - critic_missing="$critic_missing gcc" 11 | -fi 12 | +#if test $ac_verc_fail = yes; then 13 | + #critic_missing="$critic_missing gcc" 14 | +#fi 15 | 16 | for ac_prog in gnumake gmake make 17 | do 18 | @@ -5112,9 +5112,9 @@ $as_echo_n "checking version of $MAKE... " >&6; } 19 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5 20 | $as_echo "$ac_prog_version" >&6; } 21 | fi 22 | -if test $ac_verc_fail = yes; then 23 | - critic_missing="$critic_missing make" 24 | -fi 25 | +#if test $ac_verc_fail = yes; then 26 | +# critic_missing="$critic_missing make" 27 | +#fi 28 | 29 | 30 | for ac_prog in gnumsgfmt gmsgfmt msgfmt 31 | -------------------------------------------------------------------------------- /patches/fix_bad_version_checks_2.10.diff: -------------------------------------------------------------------------------- 1 | diff --git a/configure b/configure 2 | index 8c9413b14c..909d3ce20f 100755 3 | --- a/configure 4 | +++ b/configure 5 | @@ -5187,13 +5187,13 @@ else 6 | { $as_echo "$as_me:$LINENO: checking version of $CC" >&5 7 | $as_echo_n "checking version of $CC... " >&6; } 8 | ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'` 9 | - case $ac_prog_version in 10 | - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 11 | - 3.4* | 4.[0-9]* ) 12 | - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; 13 | - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 14 | + #case $ac_prog_version in 15 | + #'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 16 | + #3.4* | 4.[0-9]* ) 17 | + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no #;; 18 | + #*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 19 | 20 | - esac 21 | + #esac 22 | { $as_echo "$as_me:$LINENO: result: $ac_prog_version" >&5 23 | $as_echo "$ac_prog_version" >&6; } 24 | fi 25 | @@ -5250,13 +5250,13 @@ else 26 | { $as_echo "$as_me:$LINENO: checking version of $MAKE" >&5 27 | $as_echo_n "checking version of $MAKE... " >&6; } 28 | ac_prog_version=`$MAKE --version 2>&1 | sed -n 's/^.*GNU Make[^0-9]*\([0-9][0-9.]*\).*$/\1/p'` 29 | - case $ac_prog_version in 30 | - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 31 | - 3.79* | 3.[89]*) 32 | - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; 33 | - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 34 | + #case $ac_prog_version in 35 | + #'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 36 | + #3.79* | 3.[89]*) 37 | + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no #;; 38 | + #*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 39 | 40 | - esac 41 | + #esac 42 | { $as_echo "$as_me:$LINENO: result: $ac_prog_version" >&5 43 | $as_echo "$ac_prog_version" >&6; } 44 | fi 45 | @@ -5440,13 +5440,13 @@ else 46 | { $as_echo "$as_me:$LINENO: checking version of $SED" >&5 47 | $as_echo_n "checking version of $SED... " >&6; } 48 | ac_prog_version=`$SED --version 2>&1 | sed -n 's/^.*GNU sed version \([0-9]*\.[0-9.]*\).*$/\1/p'` 49 | - case $ac_prog_version in 50 | - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 51 | - 3.0[2-9]*|3.[1-9]*|[4-9]*) 52 | - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; 53 | - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 54 | + #case $ac_prog_version in 55 | + #'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 56 | + #3.0[2-9]*|3.[1-9]*|[4-9]*) 57 | + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no #;; 58 | + #*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 59 | 60 | - esac 61 | + #esac 62 | { $as_echo "$as_me:$LINENO: result: $ac_prog_version" >&5 63 | $as_echo "$ac_prog_version" >&6; } 64 | fi 65 | -------------------------------------------------------------------------------- /patches/fix_bad_version_checks_2.5.diff: -------------------------------------------------------------------------------- 1 | diff --git a/configure b/configure 2 | index d14f89a8a9..49f79a5ae2 100755 3 | --- a/configure 4 | +++ b/configure 5 | @@ -4040,13 +4040,13 @@ else 6 | echo "$as_me:$LINENO: checking version of $AS" >&5 7 | echo $ECHO_N "checking version of $AS... $ECHO_C" >&6 8 | ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` 9 | - case $ac_prog_version in 10 | - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 11 | - 2.1[3-9]*) 12 | - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; 13 | - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 14 | + #case $ac_prog_version in 15 | + #'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 16 | + #2.1[3-9]*) 17 | + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no #;; 18 | + #*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 19 | 20 | - esac 21 | + #esac 22 | echo "$as_me:$LINENO: result: $ac_prog_version" >&5 23 | echo "${ECHO_T}$ac_prog_version" >&6 24 | fi 25 | @@ -4101,13 +4101,13 @@ else 26 | echo "$as_me:$LINENO: checking version of $LD" >&5 27 | echo $ECHO_N "checking version of $LD... $ECHO_C" >&6 28 | ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'` 29 | - case $ac_prog_version in 30 | - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 31 | - 2.1[3-9]*) 32 | - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; 33 | - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 34 | + #case $ac_prog_version in 35 | + #'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 36 | + #2.1[3-9]*) 37 | + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no #;; 38 | + #*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 39 | 40 | - esac 41 | + #esac 42 | echo "$as_me:$LINENO: result: $ac_prog_version" >&5 43 | echo "${ECHO_T}$ac_prog_version" >&6 44 | fi 45 | @@ -4216,13 +4216,13 @@ else 46 | echo "$as_me:$LINENO: checking version of $CC" >&5 47 | echo $ECHO_N "checking version of $CC... $ECHO_C" >&6 48 | ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'` 49 | - case $ac_prog_version in 50 | - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 51 | - 3.4* | 4.[0-9]* ) 52 | - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; 53 | - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 54 | + #case $ac_prog_version in 55 | + #'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 56 | + #3.4* | 4.[0-9]* ) 57 | + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no #;; 58 | + #*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 59 | 60 | - esac 61 | + #esac 62 | echo "$as_me:$LINENO: result: $ac_prog_version" >&5 63 | echo "${ECHO_T}$ac_prog_version" >&6 64 | fi 65 | @@ -4277,13 +4277,13 @@ else 66 | echo "$as_me:$LINENO: checking version of $MAKE" >&5 67 | echo $ECHO_N "checking version of $MAKE... $ECHO_C" >&6 68 | ac_prog_version=`$MAKE --version 2>&1 | sed -n 's/^.*GNU Make[^0-9]*\([0-9][0-9.]*\).*$/\1/p'` 69 | - case $ac_prog_version in 70 | - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 71 | - 3.79* | 3.[89]*) 72 | - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; 73 | - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 74 | + #case $ac_prog_version in 75 | + # '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 76 | + # 3.79* | 3.[89]*) 77 | + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no #;; 78 | + # *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 79 | 80 | - esac 81 | + #esac 82 | echo "$as_me:$LINENO: result: $ac_prog_version" >&5 83 | echo "${ECHO_T}$ac_prog_version" >&6 84 | fi 85 | @@ -4461,13 +4461,13 @@ else 86 | echo "$as_me:$LINENO: checking version of $SED" >&5 87 | echo $ECHO_N "checking version of $SED... $ECHO_C" >&6 88 | ac_prog_version=`$SED --version 2>&1 | sed -n 's/^.*GNU sed version \([0-9]*\.[0-9.]*\).*$/\1/p'` 89 | - case $ac_prog_version in 90 | - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 91 | - 3.0[2-9]*|3.[1-9]*|[4-9]*) 92 | - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; 93 | - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 94 | + #case $ac_prog_version in 95 | + #'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 96 | + #3.0[2-9]*|3.[1-9]*|[4-9]*) 97 | + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no #;; 98 | + #*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 99 | 100 | - esac 101 | + #esac 102 | echo "$as_me:$LINENO: result: $ac_prog_version" >&5 103 | echo "${ECHO_T}$ac_prog_version" >&6 104 | fi 105 | -------------------------------------------------------------------------------- /patches/fix_bad_version_checks_2.9.diff: -------------------------------------------------------------------------------- 1 | diff --git a/configure b/configure 2 | index a2a792c93f..0a6c910cf8 100755 3 | --- a/configure 4 | +++ b/configure 5 | @@ -4529,13 +4529,13 @@ else 6 | { echo "$as_me:$LINENO: checking version of $AS" >&5 7 | echo $ECHO_N "checking version of $AS... $ECHO_C" >&6; } 8 | ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` 9 | - case $ac_prog_version in 10 | - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 11 | - 2.1[3-9]*) 12 | - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; 13 | - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 14 | + #case $ac_prog_version in 15 | + #'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 16 | + #2.1[3-9]*) 17 | + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no #;; 18 | + #*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 19 | 20 | - esac 21 | + #esac 22 | { echo "$as_me:$LINENO: result: $ac_prog_version" >&5 23 | echo "${ECHO_T}$ac_prog_version" >&6; } 24 | fi 25 | @@ -4592,13 +4592,13 @@ else 26 | { echo "$as_me:$LINENO: checking version of $LD" >&5 27 | echo $ECHO_N "checking version of $LD... $ECHO_C" >&6; } 28 | ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'` 29 | - case $ac_prog_version in 30 | - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 31 | - 2.1[3-9]*) 32 | - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; 33 | - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 34 | + #case $ac_prog_version in 35 | + #'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 36 | + #2.1[3-9]*) 37 | + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no #;; 38 | + #*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 39 | 40 | - esac 41 | + #esac 42 | { echo "$as_me:$LINENO: result: $ac_prog_version" >&5 43 | echo "${ECHO_T}$ac_prog_version" >&6; } 44 | fi 45 | @@ -4710,13 +4710,13 @@ else 46 | { echo "$as_me:$LINENO: checking version of $CC" >&5 47 | echo $ECHO_N "checking version of $CC... $ECHO_C" >&6; } 48 | ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'` 49 | - case $ac_prog_version in 50 | - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 51 | - 3.4* | 4.[0-9]* ) 52 | - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; 53 | - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 54 | + #case $ac_prog_version in 55 | + #'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 56 | + #3.4* | 4.[0-9]* ) 57 | + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no #;; 58 | + #*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 59 | 60 | - esac 61 | + #esac 62 | { echo "$as_me:$LINENO: result: $ac_prog_version" >&5 63 | echo "${ECHO_T}$ac_prog_version" >&6; } 64 | fi 65 | @@ -4773,13 +4773,13 @@ else 66 | { echo "$as_me:$LINENO: checking version of $MAKE" >&5 67 | echo $ECHO_N "checking version of $MAKE... $ECHO_C" >&6; } 68 | ac_prog_version=`$MAKE --version 2>&1 | sed -n 's/^.*GNU Make[^0-9]*\([0-9][0-9.]*\).*$/\1/p'` 69 | - case $ac_prog_version in 70 | - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 71 | - 3.79* | 3.[89]*) 72 | - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; 73 | - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 74 | + #case $ac_prog_version in 75 | + #'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 76 | + #3.79* | 3.[89]*) 77 | + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no #;; 78 | + #*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 79 | 80 | - esac 81 | + #esac 82 | { echo "$as_me:$LINENO: result: $ac_prog_version" >&5 83 | echo "${ECHO_T}$ac_prog_version" >&6; } 84 | fi 85 | @@ -4963,13 +4963,13 @@ else 86 | { echo "$as_me:$LINENO: checking version of $SED" >&5 87 | echo $ECHO_N "checking version of $SED... $ECHO_C" >&6; } 88 | ac_prog_version=`$SED --version 2>&1 | sed -n 's/^.*GNU sed version \([0-9]*\.[0-9.]*\).*$/\1/p'` 89 | - case $ac_prog_version in 90 | - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 91 | - 3.0[2-9]*|3.[1-9]*|[4-9]*) 92 | - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; 93 | - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 94 | + #case $ac_prog_version in 95 | + #'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 96 | + #3.0[2-9]*|3.[1-9]*|[4-9]*) 97 | + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no #;; 98 | + #*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 99 | 100 | - esac 101 | + #esac 102 | { echo "$as_me:$LINENO: result: $ac_prog_version" >&5 103 | echo "${ECHO_T}$ac_prog_version" >&6; } 104 | fi 105 | -------------------------------------------------------------------------------- /patches/fix_linker_failure.diff: -------------------------------------------------------------------------------- 1 | fix linker failure with newer binutils 2 | 3 | http://bugs.gentoo.org/258072 4 | 5 | commit 9ec3d5f8d876b07747fd49827e2cef8286b6f4cd 6 | Author: Ulrich Drepper 7 | Date: Sat Jan 31 00:20:55 2009 +0000 8 | 9 | (ld.so): Adjust the sed script to insert _begin in to newer linker scripts. 10 | 11 | diff --git a/elf/Makefile b/elf/Makefile 12 | index 8079fe9..e44ff1d 100644 13 | --- a/elf/Makefile 14 | +++ b/elf/Makefile 15 | @@ -304,7 +304,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map) 16 | $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 | \ 17 | LC_ALL=C \ 18 | sed -e '/^=========/,/^=========/!d;/^=========/d' \ 19 | - -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \ 20 | + -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \ 21 | > $@.lds 22 | $(LINK.o) -nostdlib -nostartfiles -shared -o $@ \ 23 | $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \ 24 | -------------------------------------------------------------------------------- /patches/fix_obstack_compat.diff: -------------------------------------------------------------------------------- 1 | diff --git a/malloc/obstack.c b/malloc/obstack.c 2 | index 5786da0aa4..c27a422077 100644 3 | --- a/malloc/obstack.c 4 | +++ b/malloc/obstack.c 5 | @@ -116,7 +116,7 @@ int obstack_exit_failure = EXIT_FAILURE; 6 | /* A looong time ago (before 1994, anyway; we're not sure) this global variable 7 | was used by non-GNU-C macros to avoid multiple evaluation. The GNU C 8 | library still exports it because somebody might use it. */ 9 | -struct obstack *_obstack_compat; 10 | +struct obstack *_obstack_compat = 0; 11 | compat_symbol (libc, _obstack_compat, _obstack, GLIBC_2_0); 12 | # endif 13 | # endif 14 | 15 | -------------------------------------------------------------------------------- /patches/hvsep-remove.diff: -------------------------------------------------------------------------------- 1 | diff --git a/manual/stdio.texi b/manual/stdio.texi 2 | index c58ca22b2d..5cb9b55fb0 100644 3 | --- a/manual/stdio.texi 4 | +++ b/manual/stdio.texi 5 | @@ -3135,7 +3135,7 @@ The postfix tag corresponds to bytes, kilobytes, megabytes, gigabytes, 6 | etc. The full table is: 7 | 8 | @ifinfo 9 | -@multitable @hsep @vsep {' '} {2^10 (1024)} {zetta} {Upper} {10^24 (1000)} 10 | +@multitable {' '} {2^10 (1024)} {zetta} {Upper} {10^24 (1000)} 11 | @item low @tab Multiplier @tab From @tab Upper @tab Multiplier 12 | @item ' ' @tab 1 @tab @tab ' ' @tab 1 13 | @item k @tab 2^10 (1024) @tab kilo @tab K @tab 10^3 (1000) 14 | -------------------------------------------------------------------------------- /patches/no-pattern-rule-mixing.diff: -------------------------------------------------------------------------------- 1 | based on commit 5a647459c82250dfd382b3bda7ec909c0e581b23 2 | Author: Andreas Schwab 3 | Date: Mon Sep 6 14:55:59 2010 +0200 4 | 5 | Don't mix pattern rules with normal rules 6 | (cherry picked from commit 32cf40699346d37fabfa887bbd95e95004799ae1) 7 | 8 | diff --git a/manual/Makefile b/manual/Makefile 9 | index c5866eb9de..b1f5fa73e5 100644 10 | --- a/manual/Makefile 11 | +++ b/manual/Makefile 12 | @@ -232,7 +232,10 @@ ifdef objpfx 13 | .PHONY: stubs 14 | stubs: $(objpfx)stubs 15 | endif 16 | -$(objpfx)stubs ../po/manual.pot $(objpfx)stamp%: 17 | +$(objpfx)stubs ../po/manual.pot: 18 | + $(make-target-directory) 19 | + touch $@ 20 | +$(objpfx)stamp%: 21 | $(make-target-directory) 22 | touch $@ 23 | 24 | -------------------------------------------------------------------------------- /patches/remove_ctors_dtors.diff: -------------------------------------------------------------------------------- 1 | See commit 4a531bb0b3b582cb693de9f76d2d97d970f9a5d5 2 | diff --git a/elf/sofini.c b/elf/sofini.c 3 | index 5e06f0ca92..eba0a2db73 100644 4 | --- a/elf/sofini.c 5 | +++ b/elf/sofini.c 6 | @@ -1,12 +1,14 @@ 7 | /* Finalizer module for ELF shared C library. This provides terminating 8 | null pointer words in the `.ctors' and `.dtors' sections. */ 9 | 10 | +#if 0 11 | static void (*const __CTOR_END__[1]) (void) 12 | __attribute__ ((used, section (".ctors"))) 13 | = { 0 }; 14 | static void (*const __DTOR_END__[1]) (void) 15 | __attribute__ ((used, section (".dtors"))) 16 | = { 0 }; 17 | +#endif 18 | 19 | /* Terminate the frame unwind info section with a 4byte 0 as a sentinel; 20 | this would be the 'length' field in a real FDE. */ 21 | diff --git a/elf/soinit.c b/elf/soinit.c 22 | index 6fecbb5674..3c253ced5a 100644 23 | --- a/elf/soinit.c 24 | +++ b/elf/soinit.c 25 | @@ -3,6 +3,7 @@ 26 | the `.ctors' and `.dtors' sections so the lists are terminated, and 27 | calling those lists of functions. */ 28 | 29 | +#if 0 30 | #include 31 | #include 32 | 33 | @@ -40,3 +41,4 @@ __libc_fini (void) 34 | 35 | void (*_fini_ptr) (void) __attribute__ ((section (".fini_array"))) 36 | = &__libc_fini; 37 | +#endif 38 | diff --git a/sysdeps/i386/init-first.c b/sysdeps/i386/init-first.c 39 | index c6355a8b7b..d79f16f0a2 100644 40 | --- a/sysdeps/i386/init-first.c 41 | +++ b/sysdeps/i386/init-first.c 42 | @@ -59,7 +59,9 @@ _init (int argc, ...) 43 | { 44 | init (&argc); 45 | 46 | +#if 0 47 | __libc_global_ctors (); 48 | +#endif 49 | } 50 | #endif 51 | 52 | diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c 53 | index f9a7a58deb..cb39d0ecda 100644 54 | --- a/sysdeps/mach/hurd/i386/init-first.c 55 | +++ b/sysdeps/mach/hurd/i386/init-first.c 56 | @@ -92,7 +92,7 @@ posixland_init (int argc, char **argv, char **envp) 57 | __getopt_clean_environment (envp); 58 | #endif 59 | 60 | -#ifdef SHARED 61 | +#if 0 62 | __libc_global_ctors (); 63 | #endif 64 | } 65 | diff --git a/sysdeps/mach/hurd/powerpc/init-first.c b/sysdeps/mach/hurd/powerpc/init-first.c 66 | index 20fa1d4f12..6e60fd0ee6 100644 67 | --- a/sysdeps/mach/hurd/powerpc/init-first.c 68 | +++ b/sysdeps/mach/hurd/powerpc/init-first.c 69 | @@ -82,7 +82,7 @@ posixland_init (int argc, char **argv, char **envp) 70 | __getopt_clean_environment (__environ); 71 | #endif 72 | 73 | -#ifdef SHARED 74 | +#if 0 75 | __libc_global_ctors (); 76 | #endif 77 | } 78 | diff --git a/sysdeps/sh/init-first.c b/sysdeps/sh/init-first.c 79 | index d816625ef4..bd685035a8 100644 80 | --- a/sysdeps/sh/init-first.c 81 | +++ b/sysdeps/sh/init-first.c 82 | @@ -59,7 +59,9 @@ _init (int argc, ...) 83 | { 84 | init (&argc); 85 | 86 | +#if 0 87 | __libc_global_ctors (); 88 | +#endif 89 | } 90 | #endif 91 | 92 | diff --git a/sysdeps/unix/sysv/linux/init-first.c b/sysdeps/unix/sysv/linux/init-first.c 93 | index 7b2333d4bf..bf618b5cf5 100644 94 | --- a/sysdeps/unix/sysv/linux/init-first.c 95 | +++ b/sysdeps/unix/sysv/linux/init-first.c 96 | @@ -93,7 +93,7 @@ _init (int argc, char **argv, char **envp) 97 | __getopt_clean_environment (envp); 98 | #endif 99 | 100 | -#ifdef SHARED 101 | +#if 0 102 | __libc_global_ctors (); 103 | #endif 104 | } 105 | -------------------------------------------------------------------------------- /patches/unwind.diff: -------------------------------------------------------------------------------- 1 | From 9d70662339289b8b49d1c83a486a49af128f1c0a Mon Sep 17 00:00:00 2001 2 | From: "H.J. Lu" 3 | Date: Sun, 15 Aug 2010 20:09:23 -0700 4 | Subject: [PATCH] Add -fno-asynchronous-unwind-tables to initfini.s for i386 5 | (cherry picked from commit f8392f40049cf6faedcf4f26736227d9a7a04b9e) 6 | 7 | --- 8 | nptl/sysdeps/unix/sysv/linux/i386/Makefile | 3 +++ 9 | sysdeps/i386/elf/Makefile | 4 ++++ 10 | 4 files changed, 15 insertions(+) 11 | create mode 100644 nptl/sysdeps/unix/sysv/linux/i386/Makefile 12 | create mode 100644 sysdeps/i386/elf/Makefile 13 | 14 | diff --git a/nptl/sysdeps/unix/sysv/linux/i386/Makefile b/nptl/sysdeps/unix/sysv/linux/i386/Makefile 15 | new file mode 100644 16 | index 0000000000..48eef38a24 17 | --- /dev/null 18 | +++ b/nptl/sysdeps/unix/sysv/linux/i386/Makefile 19 | @@ -0,0 +1,3 @@ 20 | +ifeq ($(subdir),nptl) 21 | +CFLAGS-pt-initfini.s += -fno-asynchronous-unwind-tables 22 | +endif 23 | diff --git a/sysdeps/i386/elf/Makefile b/sysdeps/i386/elf/Makefile 24 | new file mode 100644 25 | index 0000000000..61064d4ef7 26 | --- /dev/null 27 | +++ b/sysdeps/i386/elf/Makefile 28 | @@ -0,0 +1,4 @@ 29 | +ifeq ($(subdir),csu) 30 | +# Turn off -fasynchronous-unwind-tables 31 | +CFLAGS-initfini.s += -fno-asynchronous-unwind-tables 32 | +endif 33 | -- 34 | 2.17.1 35 | 36 | --------------------------------------------------------------------------------