On Sun, Nov 21, 2021 at 11:09 AM Waldemar Kozaczuk <[email protected]>
wrote:

> This last patch in the series annotates some symbols in few
> files that need to be hidden regardless if we compile kernel with
> non-glibc symbols hidden or not.


I see only a couple of these cases. Why did you need to do those specific
cases?



> For that we use OSV_HIDDEN_API macro.
>

OSV_HIDDEN.


> Signed-off-by: Waldemar Kozaczuk <[email protected]>
> ---
>  libc/libc.cc            | 2 +-
>  libc/libc.hh            | 3 ++-
>  libc/locale/uselocale.c | 2 +-
>  libc/misc/uname.c       | 3 ++-
>  4 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/libc/libc.cc b/libc/libc.cc
> index b75b3867..4fb7d574 100644
> --- a/libc/libc.cc
> +++ b/libc/libc.cc
> @@ -43,7 +43,7 @@ int libc_error(int err)
>
>  #undef errno
>
> -int __thread errno;
> +OSV_HIDDEN int __thread errno;
>
>  int* __errno_location()
>  {
> diff --git a/libc/libc.hh b/libc/libc.hh
> index cf345ce8..bba4a0a6 100644
> --- a/libc/libc.hh
> +++ b/libc/libc.hh
> @@ -10,8 +10,9 @@
>
>  #include <errno.h>
>  #include "internal/libc.h" // for the macros
> +#include <osv/export.h>
>
> -int libc_error(int err);
> +OSV_HIDDEN int libc_error(int err);
>
>  template <typename T>
>  T* libc_error_ptr(int err);
> diff --git a/libc/locale/uselocale.c b/libc/locale/uselocale.c
> index 93e65e21..bbdae028 100644
> --- a/libc/locale/uselocale.c
> +++ b/libc/locale/uselocale.c
> @@ -1,7 +1,7 @@
>  #include "locale_impl.h"
>  #include "libc.h"
>
> -__thread locale_t __current_locale;
> +OSV_HIDDEN __thread locale_t __current_locale;
>
>  locale_t __uselocale(locale_t l)
>  {
> diff --git a/libc/misc/uname.c b/libc/misc/uname.c
> index f7770ddf..3f1bf754 100644
> --- a/libc/misc/uname.c
> +++ b/libc/misc/uname.c
> @@ -7,6 +7,7 @@
>
>  #include <sys/utsname.h>
>  #include <string.h>
> +#include "osv/export.h"
>
>  // The Linux version we're pretending to be
>  #define LINUX_MAJOR 3
> @@ -23,7 +24,7 @@ _Static_assert(KERNEL_VERSION(LINUX_MAJOR, LINUX_MINOR,
> LINUX_PATCH)
>  #define str(s) #s
>  #define str2(s) str(s)
>
> -struct utsname utsname = {
> +struct utsname utsname OSV_HIDDEN = {
>         .sysname        = "Linux",      /* lie, to avoid confusing the
> payload. */
>         .nodename       = "osv.local",
>         .release        = str2(LINUX_MAJOR) "." str2(LINUX_MINOR) "."
> str2(LINUX_PATCH),
> --
> 2.31.1
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/osv-dev/20211121090925.22630-3-jwkozaczuk%40gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/CANEVyjsAOFopryMxFrLsyi8S7b%3DcJDEOZ_oUL2YQ%3DvZPuduHpA%40mail.gmail.com.

Reply via email to