VirtualBox

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

Last change on this file since 99196 was 98103, checked in by vboxsync, 23 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1/** @file
2 * IPRT - Linux symver and compatibility definitions.
3 */
4
5/*
6 * Copyright (C) 2008-2023 Oracle and/or its affiliates.
7 *
8 * This file is part of VirtualBox base platform packages, as
9 * available from https://www.virtualbox.org.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation, in version 3 of the
14 * License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, see <https://www.gnu.org/licenses>.
23 *
24 * The contents of this file may alternatively be used under the terms
25 * of the Common Development and Distribution License Version 1.0
26 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
27 * in the VirtualBox distribution, in which case the provisions of the
28 * CDDL are applicable instead of those of the GPL.
29 *
30 * You may elect to license modified versions of this file under the
31 * terms and conditions of either the GPL or the CDDL or both.
32 *
33 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
34 */
35
36/* Various tricks to produce binaries which can be run on old Linux
37 * distributions. This will almost certainly need updating as time
38 * goes by. */
39
40#ifndef IPRT_INCLUDED_linux_symvers_h
41#define IPRT_INCLUDED_linux_symvers_h
42#ifndef RT_WITHOUT_PRAGMA_ONCE
43# pragma once
44#endif
45
46/* Please use -fno-stack-protector on the command line to avoid stack check
47 * functions which are not available in EL3 for 32-bit builds. */
48
49/* Use versions of glibc symbols which are available in 32-bit EL3 or
50 * 64-bit EL4. Currently only those symbols needed by the Additions,
51 * though this could probably be extended to work for host builds too. */
52#if defined(RT_ARCH_AMD64)
53__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
54__asm__(".symver posix_spawn,posix_spawn@GLIBC_2.2.5");
55#else /* RT_ARCH_X86 */
56__asm__(".symver posix_spawn,posix_spawn@GLIBC_2.2");
57#endif
58
59/* Do not use *_chk functions */
60#undef _FORTIFY_SOURCE
61
62/* Do not use __isoc99_* functions */
63#undef __USE_GNU
64#define __USE_GNU 1
65
66/* And EL5 wants this too with __USE_GNU */
67#undef _GNU_SOURCE
68#define _GNU_SOURCE 1
69
70/* Tell IPRT not to use newer functions */
71#include <features.h>
72#undef __GLIBC_MINOR__
73#define __GLIBC_MINOR__ 3
74
75/* Do not use fcntl64 */
76#include <fcntl.h>
77#ifdef fnctl
78# undef fcntl
79#endif
80#if defined(RT_ARCH_AMD64)
81__asm__(".symver fcntl64,fcntl@GLIBC_2.2.5");
82#else
83__asm__(".symver fcntl64,fcntl@GLIBC_2.0");
84#endif
85
86/* Do not use ISO C99 scanf which has a glibc 2.7 dependency. */
87#undef __GLIBC_USE_DEPRECATED_SCANF
88#define __GLIBC_USE_DEPRECATED_SCANF 1
89#endif /* !IPRT_INCLUDED_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