Fix getauxval error at qemu
[platform/upstream/glib.git] / packaging / fix_getauxval_error_at_qemu.patch
1 diff --git a/glib/gutils.c b/glib/gutils.c
2 index 4bccd7229..c983e71c3 100644
3 --- a/glib/gutils.c
4 +++ b/glib/gutils.c
5 @@ -3011,7 +3011,24 @@ g_check_setuid (void)
6    value = getauxval (AT_SECURE);
7    errsv = errno;
8    if (errsv)
9 -    g_error ("getauxval () failed: %s", g_strerror (errsv));
10 +    {
11 +/*
12 +    Apparently, Tizen is built with qemu version < 2.12.
13 +
14 +    qemu 2.12 introduces providing AT_SECURE in auxiliary vector,
15 +    and the only purpose of using getauxval in glib is to get AT_SECURE.
16 +
17 +    If g_check_setuid() bails out with error, some packages may not build,
18 +    as their building process requires executing tools that call g_check_setuid().
19 +
20 +    So, don't bail out with error if getauxval(AT_SECURE) fails.
21 +    Instead, set the result of checking suid to FALSE (no suid).
22 +
23 +    It may be reverted if all the builds are made within qemu >= 2.12.
24 +*/
25 +/*    g_error ("getauxval () failed: %s", g_strerror (errsv));*/
26 +      return FALSE;
27 +    }
28    return value;
29  #elif defined(HAVE_ISSETUGID) && !defined(__BIONIC__)
30    /* BSD: http://www.freebsd.org/cgi/man.cgi?query=issetugid&sektion=2 */