VirtualBox

Changeset 96043 in vbox for trunk/src/VBox/Runtime/include


Ignore:
Timestamp:
Aug 4, 2022 10:08:07 PM (2 years ago)
Author:
vboxsync
Message:

IPRT,/Config.kmk,iprt/asmdefs.mac,Add/3D/Config.kmk: Generate weak CRT name aliases for nocrt_xxx function using genalias on Windows (, OS/2 and possibly macOS), while for ELF targets we'll use a RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL/RT_NOCRT_BEGINPROC macros with the function definition. bugref:10261

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/include/internal/iprt.h

    r93115 r96043  
    6464#endif
    6565
     66/** @def RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL
     67 * Creates symbol alias and export a RT_NOCRT symbol.
     68 *
     69 * For targets using ELF this macro generates weak symbol aliases, for the other
     70 * object formats the makefile scans source files for this macro and produces
     71 * separate object files with the aliases.
     72 *
     73 * @param   a_Name      The CRT function or variable name.
     74 *
     75 * @todo    Does not support ELF targets using underscore prefixed symbols.
     76 */
     77#if defined(__ELF__) && defined(RT_WITH_NOCRT_ALIASES) && !defined(RT_WITHOUT_NOCRT_ALIASES)
     78# ifdef RT_WITH_NOCRT_UNDERSCORE_ALIASES
     79#  define RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(a_Name) RT_EXPORT_SYMBOL(a_Name) \
     80    __asm__(".weak " #a_Name "\n\t" \
     81            ".set  " #a_Name "," RT_NOCRT_STR(a_Name) "\n\t" \
     82            ".weak _" #a_Name "\n\t" \
     83            ".set  _" #a_Name "," RT_NOCRT_STR(a_Name) "\n\t")
     84# else
     85#  define RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(a_Name) RT_EXPORT_SYMBOL(a_Name) \
     86    __asm__(".weak " #a_Name "\n\t" \
     87            ".set  " #a_Name "," RT_NOCRT_STR(a_Name) "\n\t")
     88# endif
     89#else
     90# define RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(a_Name) RT_EXPORT_SYMBOL(a_Name)
     91#endif
     92
     93/** @def RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL_WITHOUT_UNDERSCORE
     94 * Variant of RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL that omits the
     95 * underscore-prefixed variant of the symbol.
     96 *
     97 * @param   a_Name      The CRT function or variable name.
     98 */
     99#if defined(__ELF__) && defined(RT_WITH_NOCRT_ALIASES) && !defined(RT_WITHOUT_NOCRT_ALIASES)
     100# define RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL_WITHOUT_UNDERSCORE(a_Name) RT_EXPORT_SYMBOL(a_Name) \
     101    __asm__(".weak " #a_Name "\n\t" \
     102            ".set  " #a_Name "," RT_NOCRT_STR(a_Name) "\n\t")
     103#else
     104# define RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL_WITHOUT_UNDERSCORE(a_Name) RT_EXPORT_SYMBOL(a_Name)
     105#endif
     106
    66107
    67108/** @def RT_MORE_STRICT
Note: See TracChangeset for help on using the changeset viewer.

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