VirtualBox

source: vbox/trunk/include/iprt/linux/symvers.h@ 73945

Last change on this file since 73945 was 72087, checked in by vboxsync, 7 years ago

Fix building Linux Additions with old glibc support on EL5.
bugref:9112: Linux Additions: fix building binaries for older Linux user space
EL5 does not seem to like it when we set USE_GNU but not _GNU_SOURCE, so
fix that in include/iprt/linux/symvers.h.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
1/* $Id: symvers.h 72087 2018-05-03 12:42:07Z vboxsync $ */
2/** @file
3 * IPRT - Linux symver and compatibility definitions.
4 */
5
6/*
7 * Copyright (C) 2008-2017 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27/* Various tricks to produce binaries which can be run on old Linux
28 * distributions. This will almost certainly need updating as time
29 * goes by. */
30
31#ifndef ___iprt_linux_symvers_h
32#define ___iprt_linux_symvers_h
33
34/* Please use -fno-stack-protector on the command line to avoid stack check
35 * functions which are not available in EL3 for 32-bit builds. */
36
37/* Use versions of glibc symbols which are available in 32-bit EL3 or
38 * 64-bit EL4. Currently only those symbols needed by the Additions,
39 * though this could probably be extended to work for host builds too. */
40#if defined(RT_ARCH_AMD64)
41__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
42__asm__(".symver posix_spawn,posix_spawn@GLIBC_2.2.5");
43#else /* RT_ARCH_X86 */
44__asm__(".symver posix_spawn,posix_spawn@GLIBC_2.2");
45#endif
46
47/* Do not use *_chk functions */
48#undef _FORTIFY_SOURCE
49
50/* Do not use __isoc99_* functions */
51#undef __USE_GNU
52#define __USE_GNU 1
53
54/* And EL5 wants this too with __USE_GNU */
55#undef _GNU_SOURCE
56#define _GNU_SOURCE 1
57
58/* Tell IPRT not to use newer functions */
59#include <features.h>
60#undef __GLIBC_MINOR__
61#define __GLIBC_MINOR__ 3
62#endif /* ___iprt_linux_symvers_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette