Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
LTO: We are almost there
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6  Next  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
pigeon768
l33t
l33t


Joined: 02 Jan 2006
Posts: 675

PostPosted: Sat Jan 28, 2017 4:08 am    Post subject: Reply with quote

The sys-devel/gettext build failure is a result of being unable to find log10, which is a standard library function. You just need to add '-lm' to LDFLAGS and it still works with LTO.

This is probably an upstream bug.
Back to top
View user's profile Send private message
CaptainBlood
l33t
l33t


Joined: 24 Jan 2010
Posts: 821

PostPosted: Sat Jan 28, 2017 4:33 pm    Post subject: Reply with quote

pigeon768 wrote:
The sys-devel/gettext build failure is a result of being unable to find log10, which is a standard library function. You just need to add '-lm' to LDFLAGS and it still works with LTO.
This is probably an upstream bug.
Indeed, adding
Code:
cat /etc/portage/env/lm.conf
LDFLAGS="${LDFLAGS} -lm"
&
Code:
grep gettext /etc/portage/package.env/monolithic
sys-devel/gettext lm.conf
allowed to remove fat-lto.conf and to build against ld.gold instead of ld.bfd.

Thks 4 ur attention, interest & support.
Back to top
View user's profile Send private message
CaptainBlood
l33t
l33t


Joined: 24 Jan 2010
Posts: 821

PostPosted: Wed Feb 08, 2017 4:05 pm    Post subject: Re: LTO: We are almost there Reply with quote

costel78 wrote:
Code:
AR="/usr/bin/gcc-ar"
NM="/usr/bin/gcc-nm"
RANLIB="/usr/bin/gcc-ranlib"
has been inserted where required.Following
Code:
emerge -e world
ran flawlessly, AFAIR.
It now so appends that some package such as cross-avr/libc-1.8.0 seems to require falling back to default value for at least one them.
But what are they?:roll:
Thks 4 ur attention, interest & support.
Back to top
View user's profile Send private message
CaptainBlood
l33t
l33t


Joined: 24 Jan 2010
Posts: 821

PostPosted: Thu Feb 09, 2017 5:44 pm    Post subject: Reply with quote

Just locally patched latest mpfr ebuild
Code:
eix mpfr
[I] dev-libs/mpfr
     Available versions: 
     (1)    ~2.4.2_p3-r1
     (0)    3.1.3_p4 ~3.1.4 ~3.1.5(0/4) ~3.1.5_p1(0/4)[1] (~)3.1.5_p2(0/4)[1]
       {static-libs ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  3.1.5_p2(0/4)[?](20:00:09 09/02/2017)(-static-libs ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
     Homepage:            http://www.mpfr.org/
     Description:         library for multiple-precision floating-point computations with exact rounding
[1] /usr/local/portage
patched according 2 http://www.mpfr.org/mpfr-current/allpatches Available @https://bugs.gentoo.org/show_bug.cgi?id=608770 Comments are welcome!
Thks 4 ur attention, interest & support.
Back to top
View user's profile Send private message
CaptainBlood
l33t
l33t


Joined: 24 Jan 2010
Posts: 821

PostPosted: Thu Feb 09, 2017 6:57 pm    Post subject: Reply with quote

Pushed to the unstable portage tree...
It was into the process before I could join and attach my local portage leaf 2 bugzilla.8O
Nice. [troll]I'd whish all teams to be that efficient![/troll]
Thks guys for ur attention, interest & support.:lol:
Back to top
View user's profile Send private message
costel78
Guru
Guru


Joined: 20 Apr 2007
Posts: 305

PostPosted: Sun Feb 12, 2017 12:54 pm    Post subject: Reply with quote

Good work regarding mpfr. :D
Yes, AR="/usr/bin/gcc-ar" NM="/usr/bin/gcc-nm" RANLIB="/usr/bin/gcc-ranlib" should be optional, but there are still packages that require them throwing lto plugin is required. Indeed, no compile error is present.
It would be interesting if you are able to test packages size with/without them.
For example, dosbox is using "regular" ar, despite make.conf settings. That's why I also keep a link in /usr/local/bin ar->/usr/bin/gcc-ar and so on.
AFAIK, for now, only strip are still throw "lto plugin is required" during python compile, for example.

Speaking about python, can be build with pgo by default. Well 3.5 version take A LOT more time, but lto, graphite and pgo speed gain is ~25%.
Code:
--- python-2.7.12.ebuild   2017-01-17 22:38:42.000000000 +0200
+++ python-2.7.12-r1.ebuild   2017-01-27 22:52:43.000000000 +0200
@@ -214,7 +214,7 @@
    touch Include/graminit.h Python/graminit.c
 
    cd "${BUILD_DIR}" || die
-   emake
+   emake profile-opt
 
    # Work around bug 329499. See also bug 413751 and 457194.
    if has_version dev-libs/libffi[pax_kernel]; then

Code:
--- python-3.5.2.ebuild   2016-09-24 04:11:45.000000000 +0300
+++ python-3.5.2-r1.ebuild   2017-01-27 22:55:39.000000000 +0200
@@ -176,7 +176,7 @@
 
    cd "${BUILD_DIR}" || die
 
-   emake CPPFLAGS= CFLAGS= LDFLAGS=
+   emake profile-opt
 
    # Work around bug 329499. See also bug 413751 and 457194.
    if has_version dev-libs/libffi[pax_kernel]; then


Unfortunately I am unable to compile libreoffice-5.3.0.3 with lto anymore. If anybody can fix that, please share :)
_________________
Sorry for my English. I'm still learning this language.
Back to top
View user's profile Send private message
CaptainBlood
l33t
l33t


Joined: 24 Jan 2010
Posts: 821

PostPosted: Sun Feb 12, 2017 1:38 pm    Post subject: Reply with quote

Thks 4 pointing @ pgo which I've never took into account up to now.
My first goal could be speeding up ebuild tool chain?
Any benefit to expect in this respect?
Thks 4 ur attention, interest & support.


Last edited by CaptainBlood on Sun Feb 12, 2017 2:54 pm; edited 2 times in total
Back to top
View user's profile Send private message
costel78
Guru
Guru


Joined: 20 Apr 2007
Posts: 305

PostPosted: Sun Feb 12, 2017 2:05 pm    Post subject: Reply with quote

Well, toolchain regarding, only thing crossing my mind now is
Code:
cat /etc/portage/env/sys-devel/gcc
GCC_MAKE_TARGET="profiledbootstrap"

Expect 5-15% compile speed improvement.

IMHO the way gmp and python chose to implement profile guide optimization is preferably because is 100% automatically.
A system which use make test (where applicable) to collect performance samples would be wonderful.
_________________
Sorry for my English. I'm still learning this language.
Back to top
View user's profile Send private message
CaptainBlood
l33t
l33t


Joined: 24 Jan 2010
Posts: 821

PostPosted: Sun Feb 12, 2017 2:39 pm    Post subject: Reply with quote

Should I deduct there are at least 2 # ways 2 handle pgo?
As a side note here is
Code:

equery hasuse pgo
 * Searching for USE flag pgo ...
[IP-] [  ] dev-libs/gmp-6.1.2:0/10.4
[IP-] [  ] www-client/firefox-45.7.0:0
Thks 4 ur attention, interest & support.
Back to top
View user's profile Send private message
costel78
Guru
Guru


Joined: 20 Apr 2007
Posts: 305

PostPosted: Mon Feb 13, 2017 2:09 pm    Post subject: Reply with quote

Technically speaking is only one way to handle pgo. Compile using collect -fprofile/gperf/fdo etc, actually run program to collect profile samples and recompile using gathered data.
The difference is in the second step when program is started and run. It can be done automatically (like gcc, gmp or python using above patches) or in a very painful way - manually - like firefox.
Actually there are 3 ways to collect samples above :lol:
gcc itself is recompiles itself in 3 stages. Where make profiledbootstrap is used, in the last stage it using samples from second compile to optimize itself.
gmp and python comes with pre-fabricated test scenarios - those are ran automatically.
firefox is started and need user interaction to collect samples - needles to say, an imperfect method.

Every program written in C/C++ can benefit from pgo. The cost is: you have to manually run them - not a best case scenario - and it have to compile program at least twice.

I use this method on postgresql, php and nginx. The speed gain vary between 5-20%, depend of scenario.
_________________
Sorry for my English. I'm still learning this language.
Back to top
View user's profile Send private message
costel78
Guru
Guru


Joined: 20 Apr 2007
Posts: 305

PostPosted: Sun Feb 19, 2017 1:32 pm    Post subject: Reply with quote

Good news - no more no-graphite, it seems, at least, because I am just started to recompile gcc.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71824#c17

Patch against gcc-6.3.0:
Code:
--- a/gcc/graphite-scop-detection.c   2017/02/08 12:02:36   245277
+++ b/gcc/graphite-scop-detection.c   2017/02/08 13:13:53   245278
@@ -905,6 +905,18 @@
 
   sese_l combined = merge_sese (s1, s2);
 
+  /* Combining adjacent loops may add unrelated loops into the
+     region so we have to check all sub-loops of the outer loop
+     that are in the combined region.  */
+  if (combined)
+    for (l = loop_outer (loop)->inner; l; l = l->next)
+      if (bb_in_sese_p (l->header, combined)
+     && ! loop_is_valid_in_scop (l, combined))
+   {
+     combined = invalid_sese;
+     break;
+   }
+
   if (combined)
     s1 = combined;
   else
@@ -931,6 +943,8 @@
     && niter_desc.control.no_overflow
     && (niter = number_of_latch_executions (loop))
     && !chrec_contains_undetermined (niter)
+    && !chrec_contains_undetermined (scalar_evolution_in_region (scop,
+                         loop, niter))
     && graphite_can_represent_expr (scop, loop, niter);
 }
 
--- a/gcc/graphite-sese-to-poly.c   2017/02/08 12:02:36   245277
+++ b/gcc/graphite-sese-to-poly.c   2017/02/08 13:13:53   245278
@@ -407,7 +407,7 @@
 
     case SSA_NAME:
       gcc_assert (-1 != parameter_index_in_region_1 (e, s->scop_info)
-        || !invariant_in_sese_p_rec (e, s->scop_info->region, NULL));
+        || defined_in_sese_p (e, s->scop_info->region));
       res = extract_affine_name (s, e, space);
       break;
 
@@ -436,11 +436,11 @@
 /* Returns a linear expression for tree T evaluated in PBB.  */
 
 static isl_pw_aff *
-create_pw_aff_from_tree (poly_bb_p pbb, tree t)
+create_pw_aff_from_tree (poly_bb_p pbb, loop_p loop, tree t)
 {
   scop_p scop = PBB_SCOP (pbb);
 
-  t = scalar_evolution_in_region (scop->scop_info->region, pbb_loop (pbb), t);
+  t = scalar_evolution_in_region (scop->scop_info->region, loop, t);
 
   gcc_assert (!chrec_contains_undetermined (t));
   gcc_assert (!automatically_generated_chrec_p (t));
@@ -455,8 +455,9 @@
 static void
 add_condition_to_pbb (poly_bb_p pbb, gcond *stmt, enum tree_code code)
 {
-  isl_pw_aff *lhs = create_pw_aff_from_tree (pbb, gimple_cond_lhs (stmt));
-  isl_pw_aff *rhs = create_pw_aff_from_tree (pbb, gimple_cond_rhs (stmt));
+  loop_p loop = gimple_bb (stmt)->loop_father;
+  isl_pw_aff *lhs = create_pw_aff_from_tree (pbb, loop, gimple_cond_lhs (stmt));
+  isl_pw_aff *rhs = create_pw_aff_from_tree (pbb, loop, gimple_cond_rhs (stmt));
 
   isl_set *cond;
   switch (code)
--- /dev/null   2017/02/08 12:02:36   245277
+++ gcc/testsuite/gcc.dg/graphite/pr71824-2.c 2017/02/08 13:13:53     245278
/* { dg-do compile } */
/* { dg-options "-O2 -floop-nest-optimize" } */

typedef struct { float x1; } bx;
typedef struct {
    int w;
    short o;
} T2P;
T2P a;
int b;
void fn2();
void fn3(bx*,short);
void fn1() {
    unsigned i = 0;
    int c;
    bx *d;
    bx **h;
    if (b == 0) {
   fn2();
   return;
    }
    for (; c; c++)
      for (; i < 100; i++) {
     d = h[i];
     d->x1 = a.w;
      }
    for (; i < 100; i++) {
   d = h[i];
   d->x1 = a.w;
    }
    if (a.o)
      for (; b;)
   fn3(d, a.o);
}
--- /dev/null   2017/02/08 12:02:36   245277
+++ gcc/testsuite/gcc.dg/graphite/pr71824-3.c 2017/02/08 13:13:53     245278
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-loop-distribution -floop-nest-optimize" } */

struct
{
  int bz;
} od, ka[2];

int fw;

void
pc (void)
{
  for (od.bz = 0; od.bz < 2; ++od.bz)
    {
      ++fw;
      ka[0] = ka[1];
    }
}
--- /dev/null   2017/02/08 12:02:36   245277
+++ gcc/testsuite/gcc.dg/graphite/pr71824.c 2017/02/08 13:13:53     245278
/* { dg-do compile } */
/* { dg-options "-O2 -floop-nest-optimize" } */

int a, b, d;
int **c;
int fn1() {
    while (a)
      if (d) {
     int e = -d;
     for (; b < e; b++)
       c[b] = &a;
      } else {
     for (; b; b++)
       c[b] = &b;
     d = 0;
      }
}


Fingers are crossed, of course. :lol:
_________________
Sorry for my English. I'm still learning this language.
Back to top
View user's profile Send private message
saboya
Guru
Guru


Joined: 28 Nov 2006
Posts: 333
Location: Brazil

PostPosted: Sun Feb 19, 2017 4:04 pm    Post subject: Reply with quote

Great, thanks for the patch :)
Back to top
View user's profile Send private message
costel78
Guru
Guru


Joined: 20 Apr 2007
Posts: 305

PostPosted: Sun Feb 19, 2017 4:23 pm    Post subject: Reply with quote

Well, gcc developers deserve the thanks, not me.
Unfortunately the story is, fix something, break somewhere else.
To prevent dev-lang/orc and net-libs/nodejs to fail to compile there are another fix: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69823
Those two did not break previously due graphite. I hope gcc-6.4.0 will be launch before 7.1.0
_________________
Sorry for my English. I'm still learning this language.
Back to top
View user's profile Send private message
costel78
Guru
Guru


Joined: 20 Apr 2007
Posts: 305

PostPosted: Tue Feb 21, 2017 6:09 pm    Post subject: Reply with quote

More exclusions from package.env:
sys-apps/pciutils does compiles with lto using -flto-partition=none
media-libs/x264 need the following patch and it compiles with lto and -fno-fat-lto objects (-ffat-lto-objects only on one small portion of configure):
Code:
--- a/configure.orig   2017-01-30 20:35:01.899790305 +0000
+++ b/configure   2017-01-30 20:35:27.984073835 +0000
@@ -930,7 +930,7 @@
 CPU_ENDIAN="little-endian"
 if [ $compiler = GNU ]; then
     echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > conftest.c
-    $CC $CFLAGS conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed"
+    $CC $CFLAGS -ffat-lto-objects conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed"
     if (${cross_prefix}strings -a conftest.o | grep -q BIGE) && (${cross_prefix}strings -a conftest.o | grep -q FPendian) ; then
         define WORDS_BIGENDIAN
         CPU_ENDIAN="big-endian"

sys-auth/polkit required and older version of spidermonkey witch failed with lto. With the following patch polkit can use spidermonkey:24.
Code:
Signed-off-by: Jeremy Linton <jeremy.linton at arm.com>
---
 configure.ac                                                       | 3 +++
 src/polkitbackend/Makefile.am                                      | 7 ++++++-
 .../{polkitbackendjsauthority.c => polkitbackendjsauthority.cpp}   | 0
 test/polkitbackend/Makefile.am                                     | 3 +++
 4 files changed, 12 insertions(+), 1 deletion(-)
 rename src/polkitbackend/{polkitbackendjsauthority.c => polkitbackendjsauthority.cpp} (100%)

diff --git a/configure.ac b/configure.ac
index 97d4222..18c1f4e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,6 +30,8 @@ AC_PROG_MAKE_SET
 AC_PROG_LN_S
 AC_SYS_LARGEFILE
 AM_PROG_CC_C_O
+AC_PROG_CXX
+AX_CXX_COMPILE_STDCXX_11()
 
 # Taken from dbus
 AC_ARG_ENABLE(ansi,             [  --enable-ansi           enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
@@ -142,6 +144,7 @@ AS_IF([test x${with_mozjs} != xauto], [
   ])
 ])
 AC_SUBST(LIBJS_CFLAGS)
+AC_SUBST(LIBJS_CXXFLAGS)
 AC_SUBST(LIBJS_LIBS)
 
 EXPAT_LIB=""
diff --git a/src/polkitbackend/Makefile.am b/src/polkitbackend/Makefile.am
index a80ca36..5655d17 100644
--- a/src/polkitbackend/Makefile.am
+++ b/src/polkitbackend/Makefile.am
@@ -32,7 +32,7 @@ libpolkit_backend_1_la_SOURCES =                                            \
    polkitbackendprivate.h                        \
    polkitbackendauthority.h      polkitbackendauthority.c      \
    polkitbackendinteractiveauthority.h   polkitbackendinteractiveauthority.c   \
-   polkitbackendjsauthority.h      polkitbackendjsauthority.c      \
+   polkitbackendjsauthority.h      polkitbackendjsauthority.cpp      \
    polkitbackendactionpool.h      polkitbackendactionpool.c      \
    polkitbackendactionlookup.h      polkitbackendactionlookup.c      \
         $(NULL)
@@ -53,6 +53,8 @@ libpolkit_backend_1_la_CFLAGS =                                           \
    $(LIBJS_CFLAGS)                     \
         $(NULL)
 
+libpolkit_backend_1_la_CXXFLAGS = $(libpolkit_backend_1_la_CFLAGS) -fpermissive
+
 libpolkit_backend_1_la_LIBADD =                                     \
         $(GLIB_LIBS)                     \
    $(LIBSYSTEMD_LIBS)                  \
@@ -73,6 +75,9 @@ polkitd_SOURCES =                      \
                polkitd.c         \
    $(NULL)
 
+# force C++ link via dummy C++ file, (see GNU automake manual section 8.3.5)
+nodist_EXTRA_polkitd_SOURCES = dummy-force-cpp-link.cxx
+
 polkitd_CFLAGS =                      \
    -DPOLKIT_BACKEND_I_KNOW_API_IS_SUBJECT_TO_CHANGE      \
    -DG_LOG_DOMAIN=\"polkitd-1\"               \
diff --git a/src/polkitbackend/polkitbackendjsauthority.c b/src/polkitbackend/polkitbackendjsauthority.cpp
similarity index 100%
rename from src/polkitbackend/polkitbackendjsauthority.c
rename to src/polkitbackend/polkitbackendjsauthority.cpp
diff --git a/test/polkitbackend/Makefile.am b/test/polkitbackend/Makefile.am
index 8859c1f..53bfb2a 100644
--- a/test/polkitbackend/Makefile.am
+++ b/test/polkitbackend/Makefile.am
@@ -35,6 +35,9 @@ TEST_PROGS =
 
 TEST_PROGS += polkitbackendjsauthoritytest
 polkitbackendjsauthoritytest_SOURCES = test-polkitbackendjsauthority.c
+# force C++ link via dummy C++ file, (see GNU automake manual section 8.3.5)
+nodist_EXTRA_polkitbackendjsauthoritytest_SOURCES = dummy-force-cpp-link.cxx
+
 
 # ----------------------------------------------------------------------------------------------------
 
--
2.9.2
Signed-off-by: Jeremy Linton <jeremy.linton at arm.com>
---
 configure.ac                                   | 14 +----
 src/polkitbackend/polkitbackendjsauthority.cpp | 74 ++++++++------------------
 2 files changed, 25 insertions(+), 63 deletions(-)

diff --git a/configure.ac b/configure.ac
index 18c1f4e..f457a84 100644
--- a/configure.ac
+++ b/configure.ac
@@ -131,18 +131,8 @@ AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_30],
 AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [G_ENCODE_VERSION(2,34)],
         [Notify us when we'll need to transition away from g_type_init()])
 
-AC_ARG_WITH(mozjs, AS_HELP_STRING([--with-mozjs=@<:@mozjs185/mozjs-17.0|auto@:>@],
-                        [Specify version of Spidermonkey to use]),,
-            with_mozjs=auto)
-AS_IF([test x${with_mozjs} != xauto], [
-  PKG_CHECK_MODULES(LIBJS, ${with_mozjs})
-], [
-  PKG_CHECK_MODULES(LIBJS, [mozjs185], have_mozjs185=yes, have_mozjs185=no)
-  AS_IF([test x${have_mozjs185} = xno], [
-  PKG_CHECK_MODULES(LIBJS, [mozjs-17.0], have_mozjs17=yes,
-   [AC_MSG_ERROR([Could not find mozjs185 or mozjs-17.0; see http://ftp.mozilla.org/pub/mozilla.org/js/])])
-  ])
-])
+PKG_CHECK_MODULES(LIBJS, [mozjs-24])
+
 AC_SUBST(LIBJS_CFLAGS)
 AC_SUBST(LIBJS_CXXFLAGS)
 AC_SUBST(LIBJS_LIBS)
diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp
index 2112868..1541856 100644
--- a/src/polkitbackend/polkitbackendjsauthority.cpp
+++ b/src/polkitbackend/polkitbackendjsauthority.cpp
@@ -92,11 +92,7 @@ struct _PolkitBackendJsAuthorityPrivate
 };
 
 static JSBool execute_script_with_runaway_killer (PolkitBackendJsAuthority *authority,
-#if JS_VERSION == 186
                                                   JSScript                 *script,
-#else
-                                                  JSObject                 *script,
-#endif
                                                   jsval                    *rval);
 
 static void utils_spawn (const gchar *const  *argv,
@@ -157,17 +153,13 @@ static JSClass js_global_class = {
   "global",
   JSCLASS_GLOBAL_FLAGS,
   JS_PropertyStub,
-  JS_PropertyStub,
+  JS_DeletePropertyStub,
   JS_PropertyStub,
   JS_StrictPropertyStub,
   JS_EnumerateStub,
   JS_ResolveStub,
   JS_ConvertStub,
-#if JS_VERSION == 186     
   NULL,
-#else
-  JS_FinalizeStub,
-#endif
   JSCLASS_NO_OPTIONAL_MEMBERS
 };
 
@@ -177,17 +169,13 @@ static JSClass js_polkit_class = {
   "Polkit",
   0,
   JS_PropertyStub,
-  JS_PropertyStub,
+  JS_DeletePropertyStub,
   JS_PropertyStub,
   JS_StrictPropertyStub,
   JS_EnumerateStub,
   JS_ResolveStub,
   JS_ConvertStub,
-#if JS_VERSION == 186     
   NULL,
-#else
-  JS_FinalizeStub,
-#endif
   JSCLASS_NO_OPTIONAL_MEMBERS
 };
 
@@ -300,22 +288,14 @@ load_scripts (PolkitBackendJsAuthority  *authority)
   for (l = files; l != NULL; l = l->next)
     {
       const gchar *filename = l->data;
-#if JS_VERSION == 186
-      JSScript *script;
-#else
-      JSObject *script;
-#endif
+      JS::RootedScript script(authority->priv->cx);
+      JS::CompileOptions options(authority->priv->cx);
+      JS::RootedObject   obj(authority->priv->cx,authority->priv->js_global);
+      options.setUTF8(true);
+      script = JS::Compile (authority->priv->cx,
+                            obj, options,
+                            filename);
 
-#if JS_VERSION == 186
-      script = JS_CompileUTF8File (authority->priv->cx,
-               authority->priv->js_global,
-               filename);
-     
-#else
-      script = JS_CompileFile (authority->priv->cx,
-                authority->priv->js_global,
-                filename);
-#endif
       if (script == NULL)
         {
           polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
@@ -355,6 +335,8 @@ reload_scripts (PolkitBackendJsAuthority *authority)
 
   JS_BeginRequest (authority->priv->cx);
 
+  JSAutoCompartment ac(authority->priv->cx,  authority->priv->js_global);
+
   if (!JS_CallFunctionName(authority->priv->cx,
                            authority->priv->js_polkit,
                            "_deleteRules",
@@ -369,11 +351,7 @@ reload_scripts (PolkitBackendJsAuthority *authority)
 
   polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
                                 "Collecting garbage unconditionally...");
-#if JS_VERSION == 186
   JS_GC (authority->priv->rt);
-#else
-  JS_GC (authority->priv->cx);
-#endif
 
   load_scripts (authority);
 
@@ -465,7 +443,7 @@ polkit_backend_js_authority_constructed (GObject *object)
   PolkitBackendJsAuthority *authority = POLKIT_BACKEND_JS_AUTHORITY (object);
   gboolean entered_request = FALSE;
 
-  authority->priv->rt = JS_NewRuntime (8L * 1024L * 1024L);
+  authority->priv->rt = JS_NewRuntime (8L * 1024L * 1024L, JS_USE_HELPER_THREADS);
   if (authority->priv->rt == NULL)
     goto fail;
 
@@ -479,19 +457,17 @@ polkit_backend_js_authority_constructed (GObject *object)
   JS_SetOptions (authority->priv->cx,
                  JSOPTION_VAROBJFIX
                  /* | JSOPTION_JIT | JSOPTION_METHODJIT*/);
-  JS_SetVersion(authority->priv->cx, JSVERSION_LATEST);
   JS_SetErrorReporter(authority->priv->cx, report_error);
   JS_SetContextPrivate (authority->priv->cx, authority);
 
   JS_BeginRequest(authority->priv->cx);
   entered_request = TRUE;
 
-  authority->priv->js_global =
-#if JS_VERSION == 186
-    JS_NewGlobalObject (authority->priv->cx, &js_global_class, NULL);
-#else
-    JS_NewCompartmentAndGlobalObject (authority->priv->cx, &js_global_class, NULL);
-#endif
+  {
+  JS::CompartmentOptions compart_opts;
+  compart_opts.setVersion(JSVERSION_LATEST);
+  authority->priv->js_global = JS_NewGlobalObject (authority->priv->cx, &js_global_class, NULL, compart_opts);
+  JSAutoCompartment ac(authority->priv->cx,  authority->priv->js_global);
 
   if (authority->priv->js_global == NULL)
     goto fail;
@@ -548,11 +524,12 @@ polkit_backend_js_authority_constructed (GObject *object)
 
   setup_file_monitors (authority);
   load_scripts (authority);
-
+  }
   JS_EndRequest (authority->priv->cx);
   entered_request = FALSE;
 
   G_OBJECT_CLASS (polkit_backend_js_authority_parent_class)->constructed (object);
+
   return;
 
  fail:
@@ -766,7 +743,6 @@ subject_to_jsval (PolkitBackendJsAuthority  *authority,
   char *session_str = NULL;
 
   src = "new Subject();";
-
   if (!JS_EvaluateScript (authority->priv->cx,
                           authority->priv->js_global,
                           src, strlen (src),
@@ -999,11 +975,7 @@ rkt_on_timeout (gpointer user_data)
   g_mutex_unlock (&authority->priv->rkt_timeout_pending_mutex);
 
   /* Supposedly this is thread-safe... */
-#if JS_VERSION == 186
   JS_TriggerOperationCallback (authority->priv->rt);
-#else
-  JS_TriggerOperationCallback (authority->priv->cx);
-#endif
 
   /* keep source around so we keep trying to kill even if the JS bit catches the exception
    * thrown in js_operation_callback()
@@ -1041,11 +1013,7 @@ runaway_killer_teardown (PolkitBackendJsAuthority *authority)
 
 static JSBool
 execute_script_with_runaway_killer (PolkitBackendJsAuthority *authority,
-#if JS_VERSION == 186
                                     JSScript                 *script,
-#else
-                                    JSObject                 *script,
-#endif
                                     jsval                    *rval)
 {
   JSBool ret;
@@ -1103,6 +1071,8 @@ polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveA
 
   JS_BeginRequest (authority->priv->cx);
 
+  JSAutoCompartment ac(authority->priv->cx,  authority->priv->js_global);
+
   if (!action_and_details_to_jsval (authority, action_id, details, &argv[0], &error))
     {
       polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
@@ -1212,6 +1182,8 @@ polkit_backend_js_authority_check_authorization_sync (PolkitBackendInteractiveAu
 
   JS_BeginRequest (authority->priv->cx);
 
+  JSAutoCompartment ac(authority->priv->cx,  authority->priv->js_global);
+
   if (!action_and_details_to_jsval (authority, action_id, details, &argv[0], &error))
     {
       polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
--
2.9.2
Signed-off-by: Jeremy Linton <jeremy.linton at arm.com>
---
 src/polkitbackend/Makefile.am                  |   2 +-
 src/polkitbackend/polkitbackendjsauthority.cpp | 148 ++++++++++++-------------
 2 files changed, 75 insertions(+), 75 deletions(-)

diff --git a/src/polkitbackend/Makefile.am b/src/polkitbackend/Makefile.am
index 5655d17..ca62474 100644
--- a/src/polkitbackend/Makefile.am
+++ b/src/polkitbackend/Makefile.am
@@ -53,7 +53,7 @@ libpolkit_backend_1_la_CFLAGS =                                           \
    $(LIBJS_CFLAGS)                     \
         $(NULL)
 
-libpolkit_backend_1_la_CXXFLAGS = $(libpolkit_backend_1_la_CFLAGS) -fpermissive
+libpolkit_backend_1_la_CXXFLAGS = $(libpolkit_backend_1_la_CFLAGS)
 
 libpolkit_backend_1_la_LIBADD =                                     \
         $(GLIB_LIBS)                     \
diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp
index 1541856..ce3a980 100644
--- a/src/polkitbackend/polkitbackendjsauthority.cpp
+++ b/src/polkitbackend/polkitbackendjsauthority.cpp
@@ -287,7 +287,7 @@ load_scripts (PolkitBackendJsAuthority  *authority)
 
   for (l = files; l != NULL; l = l->next)
     {
-      const gchar *filename = l->data;
+      const gchar *filename = (gchar *)l->data;
       JS::RootedScript script(authority->priv->cx);
       JS::CompileOptions options(authority->priv->cx);
       JS::RootedObject   obj(authority->priv->cx,authority->priv->js_global);
@@ -464,66 +464,66 @@ polkit_backend_js_authority_constructed (GObject *object)
   entered_request = TRUE;
 
   {
-  JS::CompartmentOptions compart_opts;
-  compart_opts.setVersion(JSVERSION_LATEST);
-  authority->priv->js_global = JS_NewGlobalObject (authority->priv->cx, &js_global_class, NULL, compart_opts);
-  JSAutoCompartment ac(authority->priv->cx,  authority->priv->js_global);
-
-  if (authority->priv->js_global == NULL)
-    goto fail;
-  JS_AddObjectRoot (authority->priv->cx, &authority->priv->js_global);
-
-  if (!JS_InitStandardClasses (authority->priv->cx, authority->priv->js_global))
-    goto fail;
-
-  authority->priv->js_polkit = JS_DefineObject (authority->priv->cx,
-                                                authority->priv->js_global,
-                                                "polkit",
-                                                &js_polkit_class,
-                                                NULL,
-                                                JSPROP_ENUMERATE);
-  if (authority->priv->js_polkit == NULL)
-    goto fail;
-  JS_AddObjectRoot (authority->priv->cx, &authority->priv->js_polkit);
-
-  if (!JS_DefineFunctions (authority->priv->cx,
-                           authority->priv->js_polkit,
-                           js_polkit_functions))
-    goto fail;
-
-  if (!JS_EvaluateScript (authority->priv->cx,
-                          authority->priv->js_global,
-                          init_js, strlen (init_js), /* init.js */
-                          "init.js",  /* filename */
-                          0,     /* lineno */
-                          NULL)) /* rval */
-    {
+    JS::CompartmentOptions compart_opts;
+    compart_opts.setVersion(JSVERSION_LATEST);
+    authority->priv->js_global = JS_NewGlobalObject (authority->priv->cx, &js_global_class, NULL, compart_opts);
+    JSAutoCompartment ac(authority->priv->cx,  authority->priv->js_global);
+
+    if (authority->priv->js_global == NULL)
+      goto fail;
+    JS_AddObjectRoot (authority->priv->cx, &authority->priv->js_global);
+
+    if (!JS_InitStandardClasses (authority->priv->cx, authority->priv->js_global))
+      goto fail;
+
+    authority->priv->js_polkit = JS_DefineObject (authority->priv->cx,
+                                                  authority->priv->js_global,
+                                                  "polkit",
+                                                  &js_polkit_class,
+                                                  NULL,
+                                                  JSPROP_ENUMERATE);
+    if (authority->priv->js_polkit == NULL)
+      goto fail;
+    JS_AddObjectRoot (authority->priv->cx, &authority->priv->js_polkit);
+
+    if (!JS_DefineFunctions (authority->priv->cx,
+                             authority->priv->js_polkit,
+                             js_polkit_functions))
       goto fail;
-    }
-
-  if (authority->priv->rules_dirs == NULL)
-    {
-      authority->priv->rules_dirs = g_new0 (gchar *, 3);
-      authority->priv->rules_dirs[0] = g_strdup (PACKAGE_SYSCONF_DIR "/polkit-1/rules.d");
-      authority->priv->rules_dirs[1] = g_strdup (PACKAGE_DATA_DIR "/polkit-1/rules.d");
-    }
-
-  g_mutex_init (&authority->priv->rkt_init_mutex);
-  g_cond_init (&authority->priv->rkt_init_cond);
-  g_mutex_init (&authority->priv->rkt_timeout_pending_mutex);
-
-  authority->priv->runaway_killer_thread = g_thread_new ("runaway-killer-thread",
-                                                         runaway_killer_thread_func,
-                                                         authority);
-
-  /* wait for runaway_killer_thread to set up its GMainContext */
-  g_mutex_lock (&authority->priv->rkt_init_mutex);
-  while (authority->priv->rkt_context == NULL)
-    g_cond_wait (&authority->priv->rkt_init_cond, &authority->priv->rkt_init_mutex);
-  g_mutex_unlock (&authority->priv->rkt_init_mutex);
-
-  setup_file_monitors (authority);
-  load_scripts (authority);
+
+    if (!JS_EvaluateScript (authority->priv->cx,
+                            authority->priv->js_global,
+                            init_js, strlen (init_js), /* init.js */
+                            "init.js",  /* filename */
+                            0,     /* lineno */
+                            NULL)) /* rval */
+      {
+        goto fail;
+      }
+
+    if (authority->priv->rules_dirs == NULL)
+      {
+        authority->priv->rules_dirs = g_new0 (gchar *, 3);
+        authority->priv->rules_dirs[0] = g_strdup (PACKAGE_SYSCONF_DIR "/polkit-1/rules.d");
+        authority->priv->rules_dirs[1] = g_strdup (PACKAGE_DATA_DIR "/polkit-1/rules.d");
+      }
+
+    g_mutex_init (&authority->priv->rkt_init_mutex);
+    g_cond_init (&authority->priv->rkt_init_cond);
+    g_mutex_init (&authority->priv->rkt_timeout_pending_mutex);
+
+    authority->priv->runaway_killer_thread = g_thread_new ("runaway-killer-thread",
+                                                           runaway_killer_thread_func,
+                                                           authority);
+
+    /* wait for runaway_killer_thread to set up its GMainContext */
+    g_mutex_lock (&authority->priv->rkt_init_mutex);
+    while (authority->priv->rkt_context == NULL)
+      g_cond_wait (&authority->priv->rkt_init_cond, &authority->priv->rkt_init_mutex);
+    g_mutex_unlock (&authority->priv->rkt_init_mutex);
+
+    setup_file_monitors (authority);
+    load_scripts (authority);
   }
   JS_EndRequest (authority->priv->cx);
   entered_request = FALSE;
@@ -559,7 +559,7 @@ polkit_backend_js_authority_finalize (GObject *object)
     {
       GFileMonitor *monitor = authority->priv->dir_monitors[n];
       g_signal_handlers_disconnect_by_func (monitor,
-                                            G_CALLBACK (on_dir_monitor_changed),
+                                            (gpointer*)G_CALLBACK (on_dir_monitor_changed),
                                             authority);
       g_object_unref (monitor);
     }
@@ -645,7 +645,7 @@ polkit_backend_js_authority_class_init (PolkitBackendJsAuthorityClass *klass)
                                                        NULL,
                                                        NULL,
                                                        G_TYPE_STRV,
-                                                       G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE));
+                                                       GParamFlags(G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE)));
 
 
   g_type_class_add_private (klass, sizeof (PolkitBackendJsAuthorityPrivate));
@@ -685,7 +685,7 @@ set_property_strv (PolkitBackendJsAuthority  *authority,
       JSString *jsstr;
       jsval val;
 
-      jsstr = JS_NewStringCopyZ (authority->priv->cx, g_ptr_array_index(value, n));
+      jsstr = JS_NewStringCopyZ (authority->priv->cx, (char *)g_ptr_array_index(value, n));
       val = STRING_TO_JSVAL (jsstr);
       JS_SetElement (authority->priv->cx, array_object, n, &val);
     }
@@ -1347,8 +1347,8 @@ spawn_cb (GObject       *source_object,
           GAsyncResult  *res,
           gpointer       user_data)
 {
-  SpawnData *data = user_data;
-  data->res = g_object_ref (res);
+  SpawnData *data = (SpawnData *)user_data;
+  data->res = (GAsyncResult*)g_object_ref (res);
   g_main_loop_quit (data->loop);
 }
 
@@ -1657,7 +1657,7 @@ static void
 utils_on_cancelled (GCancellable *cancellable,
                     gpointer      user_data)
 {
-  UtilsSpawnData *data = user_data;
+  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
   GError *error;
 
   error = NULL;
@@ -1672,7 +1672,7 @@ utils_read_child_stderr (GIOChannel *channel,
                          GIOCondition condition,
                          gpointer user_data)
 {
-  UtilsSpawnData *data = user_data;
+  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
   gchar buf[1024];
   gsize bytes_read;
 
@@ -1686,7 +1686,7 @@ utils_read_child_stdout (GIOChannel *channel,
                          GIOCondition condition,
                          gpointer user_data)
 {
-  UtilsSpawnData *data = user_data;
+  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
   gchar buf[1024];
   gsize bytes_read;
 
@@ -1700,7 +1700,7 @@ utils_child_watch_cb (GPid     pid,
                       gint     status,
                       gpointer user_data)
 {
-  UtilsSpawnData *data = user_data;
+  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
   gchar *buf;
   gsize buf_size;
 
@@ -1729,7 +1729,7 @@ utils_child_watch_cb (GPid     pid,
 static gboolean
 utils_timeout_cb (gpointer user_data)
 {
-  UtilsSpawnData *data = user_data;
+  UtilsSpawnData *data = (UtilsSpawnData *)user_data;
 
   data->timed_out = TRUE;
 
@@ -1758,12 +1758,12 @@ utils_spawn (const gchar *const  *argv,
   data->simple = g_simple_async_result_new (NULL,
                                             callback,
                                             user_data,
-                                            utils_spawn);
+                                            (gpointer*)utils_spawn);
   data->main_context = g_main_context_get_thread_default ();
   if (data->main_context != NULL)
     g_main_context_ref (data->main_context);
 
-  data->cancellable = cancellable != NULL ? g_object_ref (cancellable) : NULL;
+  data->cancellable = cancellable != NULL ? (GCancellable*)g_object_ref (cancellable) : NULL;
 
   data->child_stdout = g_string_new (NULL);
   data->child_stderr = g_string_new (NULL);
@@ -1796,7 +1796,7 @@ utils_spawn (const gchar *const  *argv,
   if (!g_spawn_async_with_pipes (NULL, /* working directory */
                                  (gchar **) argv,
                                  NULL, /* envp */
-                                 G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
+                                 GSpawnFlags(G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD),
                                  NULL, /* child_setup */
                                  NULL, /* child_setup's user_data */
                                  &(data->child_pid),
@@ -1863,7 +1863,7 @@ utils_spawn_finish (GAsyncResult   *res,
   if (g_simple_async_result_propagate_error (simple, error))
     goto out;
 
-  data = g_simple_async_result_get_op_res_gpointer (simple);
+  data = (UtilsSpawnData*)g_simple_async_result_get_op_res_gpointer (simple);
 
   if (data->timed_out)
     {
--
2.9.2
Signed-off-by: Jeremy Linton <jeremy.linton at arm.com>
---
 src/polkitbackend/polkitbackendjsauthority.cpp | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp
index ce3a980..6a0b4ab 100644
--- a/src/polkitbackend/polkitbackendjsauthority.cpp
+++ b/src/polkitbackend/polkitbackendjsauthority.cpp
@@ -76,6 +76,7 @@ struct _PolkitBackendJsAuthorityPrivate
   JSRuntime *rt;
   JSContext *cx;
   JSObject *js_global;
+  JSAutoCompartment *ac;
   JSObject *js_polkit;
 
   GThread *runaway_killer_thread;
@@ -335,8 +336,6 @@ reload_scripts (PolkitBackendJsAuthority *authority)
 
   JS_BeginRequest (authority->priv->cx);
 
-  JSAutoCompartment ac(authority->priv->cx,  authority->priv->js_global);
-
   if (!JS_CallFunctionName(authority->priv->cx,
                            authority->priv->js_polkit,
                            "_deleteRules",
@@ -467,10 +466,15 @@ polkit_backend_js_authority_constructed (GObject *object)
     JS::CompartmentOptions compart_opts;
     compart_opts.setVersion(JSVERSION_LATEST);
     authority->priv->js_global = JS_NewGlobalObject (authority->priv->cx, &js_global_class, NULL, compart_opts);
-    JSAutoCompartment ac(authority->priv->cx,  authority->priv->js_global);
 
     if (authority->priv->js_global == NULL)
       goto fail;
+
+    authority->priv->ac = new JSAutoCompartment(authority->priv->cx,  authority->priv->js_global);
+
+    if (authority->priv->ac == NULL)
+      goto fail;
+
     JS_AddObjectRoot (authority->priv->cx, &authority->priv->js_global);
 
     if (!JS_InitStandardClasses (authority->priv->cx, authority->priv->js_global))
@@ -568,6 +572,7 @@ polkit_backend_js_authority_finalize (GObject *object)
 
   JS_BeginRequest (authority->priv->cx);
   JS_RemoveObjectRoot (authority->priv->cx, &authority->priv->js_polkit);
+  delete authority->priv->ac;
   JS_RemoveObjectRoot (authority->priv->cx, &authority->priv->js_global);
   JS_EndRequest (authority->priv->cx);
 
@@ -1071,8 +1076,6 @@ polkit_backend_js_authority_get_admin_auth_identities (PolkitBackendInteractiveA
 
   JS_BeginRequest (authority->priv->cx);
 
-  JSAutoCompartment ac(authority->priv->cx,  authority->priv->js_global);
-
   if (!action_and_details_to_jsval (authority, action_id, details, &argv[0], &error))
     {
       polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
@@ -1182,8 +1185,6 @@ polkit_backend_js_authority_check_authorization_sync (PolkitBackendInteractiveAu
 
   JS_BeginRequest (authority->priv->cx);
 
-  JSAutoCompartment ac(authority->priv->cx,  authority->priv->js_global);
-
   if (!action_and_details_to_jsval (authority, action_id, details, &argv[0], &error))
     {
       polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
--
2.9.2


Unfortunately, there is one (re)addition libreoffice 5.3.0 I presume it's not a big error - a Makefile one - but is beyond my expertise.

Edit reason: typo.
_________________
Sorry for my English. I'm still learning this language.
Back to top
View user's profile Send private message
costel78
Guru
Guru


Joined: 20 Apr 2007
Posts: 305

PostPosted: Sat Feb 25, 2017 2:17 pm    Post subject: Reply with quote

Until gcc-config will handle liblto_plugin and gcc wrappers will be no longer required, here is my handy script to switch between gcc versions:
Code:
#!/bin/bash
CURRENT="$1"
# Check if parameter is an natural number
if ! [[ "$CURRENT" =~ ^[0-9]+$ ]]; then
  echo "Not good enought..."
  exit 1
fi

# Total number of options
MAX="$(gcc-config -l | wc -l)"

# Check if parameter is in allowable range of options
if ! [[ "$CURRENT" -ge "1" && "$CURRENT" -le "$MAX" ]]; then
  echo "Not good enought..."
  exit 2
fi

# Switch gcc
gcc-config "$1"
if [ "$?" -ne 0 ]; then
  echo "Well, something is screw up..."
  exit 3
fi

env-update && source /etc/profile
# GCC version
VER="$(gcc --version | grep ^gcc | sed 's/^.* //g')"
# CHOST
TARGET="$(gcc -dumpmachine)"

# Make symlinks
for f in ar nm ranlib ; do
  rm /usr/local/bin/$f &>/dev/null
  rm /usr/local/bin/$TARGET-$f &>/dev/null
  ln -s /usr/$TARGET/gcc-bin/$VER/gcc-$f /usr/local/bin/$f
  ln -s /usr/$TARGET/gcc-bin/$VER/gcc-$f /usr/local/bin/$TARGET-$f
done
rm /usr/$TARGET/binutils-bin/lib/bfd-plugins/liblto_plugin.so.0.0.0 &>/dev/null
mkdir -p /usr/$TARGET/binutils-bin/lib/bfd-plugins/ &>/dev/null
ln -s /usr/libexec/gcc/$TARGET/$VER/liblto_plugin.so.0.0.0 /usr/$TARGET/binutils-bin/lib/bfd-plugins/

# Show symlinks
ls -als /usr/$TARGET/binutils-bin/lib/bfd-plugins/liblto_plugin.so.0.0.0 /usr/local/bin/


I played with gcc-7. There are 4 failed packages, 12 gcc ICE (well, is not ready yet, is a beta version) and no change regarding package.env
_________________
Sorry for my English. I'm still learning this language.
Back to top
View user's profile Send private message
potenzial
n00b
n00b


Joined: 11 Oct 2004
Posts: 10
Location: Earth, Germany, Essen

PostPosted: Mon Mar 27, 2017 5:02 pm    Post subject: Reply with quote

Anyone got luck with pulseaudio and lto ?
I get this error:
Code:

/var/tmp/portage/media-sound/pulseaudio-10.0/temp/ccsqOrEF.ltrans6.ltrans.o: In function `pa_dump_modules':
<artificial>:(.text.pa_dump_modules+0x230): undefined reference to `lt__PROGRAM__LTX_preloaded_symbols'
<artificial>:(.text.pa_dump_modules+0x238): undefined reference to `lt__PROGRAM__LTX_preloaded_symbols'
/var/tmp/portage/media-sound/pulseaudio-10.0/temp/ccsqOrEF.ltrans0.ltrans.o: In function `main':
<artificial>:(.text.startup.main+0x58c): undefined reference to `lt__PROGRAM__LTX_preloaded_symbols'
/var/tmp/portage/media-sound/pulseaudio-10.0/temp/ccsqOrEF.ltrans3.ltrans.o: In function `callback.lto_priv.9':
<artificial>:(.text.callback.lto_priv.9+0x7a): undefined reference to `lt__PROGRAM__LTX_preloaded_symbols'
<artificial>:(.text.callback.lto_priv.9+0x88): undefined reference to `lt__PROGRAM__LTX_preloaded_symbols'

I tried -fno-fat-lto-objects and -flto-partition=none no effect
Back to top
View user's profile Send private message
costel78
Guru
Guru


Joined: 20 Apr 2007
Posts: 305

PostPosted: Tue Mar 28, 2017 10:25 am    Post subject: Reply with quote

Pulseaudio intermittently suffered from this issue. It is a reported bug on free desktop and the promises are that it will be fixed on ver. 11
_________________
Sorry for my English. I'm still learning this language.
Back to top
View user's profile Send private message
trippels
Tux's lil' helper
Tux's lil' helper


Joined: 24 Nov 2010
Posts: 137
Location: Berlin

PostPosted: Tue Mar 28, 2017 10:56 am    Post subject: Reply with quote

costel78 wrote:

I played with gcc-7. There are 4 failed packages, 12 gcc ICE (well, is not ready yet, is a beta version) and no change regarding package.env


Please report those ICEs here: http://gcc.gnu.org/bugzilla/.
(see https://gcc.gnu.org/bugs/ on what information is required when filing bugs)
A gcc-7 release candidate will be released shortly.
Back to top
View user's profile Send private message
costel78
Guru
Guru


Joined: 20 Apr 2007
Posts: 305

PostPosted: Sat Apr 01, 2017 7:43 am    Post subject: Reply with quote

I do not know how actual those bugs are. There were over 20 P1 open bugs then, and today there are only 6.
Right now I am not using gcc-7.0.1. When a release candidate will be released I'll try again.
_________________
Sorry for my English. I'm still learning this language.
Back to top
View user's profile Send private message
roarinelk
Guru
Guru


Joined: 04 Mar 2004
Posts: 493

PostPosted: Tue Apr 04, 2017 8:10 am    Post subject: Reply with quote

One thing that gets rid of a lot of link failures with LTO is adding

Code:
LDFLAGS="-Wl,--no-as-needed"


to the environment (make.conf or the lto-enabled env entry).
Gentoo adds "-Wl,--as-needed" as a default linker flag unconditionally, this can cause the linker to miss weak symbols, which it otherwise
will not. At least current mesa-9999 is affected by this for example.
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 4816
Location: The Peanut Gallery

PostPosted: Mon Apr 17, 2017 6:48 am    Post subject: Reply with quote

roarinelk, that's true; the default LDFLAGS="-Wl,-O1 -Wl,--as-needed", so you can just reset to LDFLAGS="-Wl,-O1".

Note that you're not adding --no-as-needed in your stanza; you'd need to use LDFLAGS="$LDFLAGS -Wl,--no-as-needed"
You can't use += afair, as python shlex doesn't support it.

There are some other nice ones, like --hash-style=gnu -z,relro -z,combreloc that are relatively safe. -z,now might break lto though.
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 5754

PostPosted: Mon Apr 17, 2017 8:02 am    Post subject: Reply with quote

steveL wrote:
-z,now might break lto though.

I never heard about that. The only cases I know where -z,now causes harm are mesa, xorgs-server, and xf86-*, because unfortunately xorg loads its modules in a non-standard forced-lazy way.
If possible, I would never compile anything without -z,now -z,relro because this combination increases security: It makes it harder to exploit bugs to execute arbitrary code.
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 4816
Location: The Peanut Gallery

PostPosted: Mon Apr 17, 2017 7:35 pm    Post subject: Reply with quote

steveL wrote:
-z,now might break lto though.
mv wrote:
I never heard about that. The only cases I know where -z,now causes harm are mesa, xorgs-server, and xf86-*, because unfortunately xorg loads its modules in a non-standard forced-lazy way.
If possible, I would never compile anything without -z,now -z,relro because this combination increases security: It makes it harder to exploit bugs to execute arbitrary code.
Yeah, I've been using it for years; glad you say that it doesn't affect lto.
Never had any issues using it with xorg, personally; though I was on nvidia blobs for a decade or so.
Back to top
View user's profile Send private message
CaptainBlood
l33t
l33t


Joined: 24 Jan 2010
Posts: 821

PostPosted: Sun May 14, 2017 11:42 am    Post subject: Reply with quote

Hi,
Just a side note 2 point qtgui:4 & :5 ebuilds both force fat-lto.
Thks 4 ur attention
Back to top
View user's profile Send private message
CaptainBlood
l33t
l33t


Joined: 24 Jan 2010
Posts: 821

PostPosted: Wed May 24, 2017 10:29 am    Post subject: Re: LTO: We are almost there Reply with quote

Child_of_Sun_24 wrote:
if the Patch only add the --enable-lto option you could set it via the EXTRA_ECONF in /etc/portage/env and then enable the use of the configuration in /etc/portage/package.env

For example:
/etc/portage/env/libreoffice.conf:
EXTRA_ECONF="--enable-lto"

/etc/portage/package.env/libreoffice:
app-office/libreoffice libreoffice.conf

Should work with all Versions that support --enable-lto. And you don't need to apply a Patch every time when there is a new version.


Doesn't work anymore here with app-office/libreoffice-5.2.7 & gcc 5.4.

Am I the only one?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 5 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum