Re: [gentoo-user] Re: ~gcc-4.7.0

2012-06-01 Thread Hinnerk van Bruinehsen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02.06.2012 04:37, Nilesh Govindrajan wrote:
> On Jun 2, 2012 6:08 AM, "walt"  wrote:

> 
> Has anyone tried compiling chromium 20 (as of yesterday) and
> libreoffice 3.5.4.2 using gcc 4.7.0? I am unable to do so. Using
> unstable Amd64.
> 
> -- Nilesh Govindrajan http://nileshgr.com
> 

Openoffice: No

Chromium >20: Yes - they're a bit of a PITA...

It won't work without some patches. Mostly missing includes for
unistd.h (in most files is a

#if defined(OS_ANDROID)
#include 
#endif

where it is needed (ideally in a #id defined(OS_POSIX) (or LINUX?)
#endif block).

I've got no time to look into the versions 20.x to <21.0.1155.2 and my
custom patch for 21.0.1155.2 also fixes a selinux related issue.

If you google you'll find some other patches (even one on
bugs.gentoo.org) which max work for you (depends on version, I think).

I'll attach my patch for reference.

WKR
Hinnerk
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPybgeAAoJEJwwOFaNFkYcu2YIAIa3xtDXMD7hFy/7iI5yEhd2
eLE5+GswNKYdCeYRaLvuqQpWJnm2GZj7UQVklxd1qgA2UhxgHCZkiya5Uj8M3va6
iE8e2TfCwAUqkL69/9HAXQh+cuHreq7ZAP9/+1yUaH8NOa9gZluIzyZv/TtO/PiJ
wDK6Zhar/MlpFOrduz3m0gFuJun1fruVGvT9cIWRTDSsMmsGm6l88JNG1YyXtmZV
yoL5ZfT0g+Lw1IJ6C03WEFG8yW/nXjE9wIojjzQoC3fkBmTPNWmcXdz5LzPx8T+P
rc9WQf8IGRQwA8ME8LPEJZdGxZmT170nOs74TqwJOs7F2YGAwL+N0euHF8DCilg=
=16Fc
-END PGP SIGNATURE-
diff -ru chromium-21.0.1155.2/chrome/browser/policy/policy_path_parser_linux.cc chromium-21.0.1155.2.new/chrome/browser/policy/policy_path_parser_linux.cc
--- chromium-21.0.1155.2/chrome/browser/policy/policy_path_parser_linux.cc	2012-05-30 03:47:01.0 +0200
+++ chromium-21.0.1155.2.new/chrome/browser/policy/policy_path_parser_linux.cc	2012-05-30 23:53:01.123823731 +0200
@@ -4,6 +4,10 @@
 
 #include 
 
+//#if defined(OS_POSIX)
+#include 
+//#endif
+
 #include "chrome/browser/policy/policy_path_parser.h"
 
 #include "base/logging.h"
diff -ru chromium-21.0.1155.2/content/public/common/sandbox_init.cc chromium-21.0.1155.2.new/content/public/common/sandbox_init.cc
--- chromium-21.0.1155.2/content/public/common/sandbox_init.cc	2012-05-30 03:46:30.0 +0200
+++ chromium-21.0.1155.2.new/content/public/common/sandbox_init.cc	2012-05-30 17:09:00.044889918 +0200
@@ -6,6 +6,8 @@
 
 #if defined(OS_ANDROID)
 #include 
+#elif defined(OS_POSIX)
+#include 
 #endif
 
 namespace content {
diff -ru chromium-21.0.1155.2/content/zygote/zygote_linux.cc chromium-21.0.1155.2.new/content/zygote/zygote_linux.cc
--- chromium-21.0.1155.2/content/zygote/zygote_linux.cc	2012-05-30 03:46:27.0 +0200
+++ chromium-21.0.1155.2.new/content/zygote/zygote_linux.cc	2012-05-31 04:04:32.072791812 +0200
@@ -31,10 +31,38 @@
 #include "content/common/sandbox_methods_linux.h"
 #include "content/common/zygote_commands_linux.h"
 
+#if defined(CHROMIUM_SELINUX)
+#include 
+#include 
+#endif
+
 // See http://code.google.com/p/chromium/wiki/LinuxZygote
 
 namespace content {
 
+
+#if defined(CHROMIUM_SELINUX)
+static void SELinuxTransitionToTypeOrDie(char const* type) {
+  security_context_t security_context;
+  if (getcon(&security_context))
+LOG(FATAL) << "Cannot get SELinux context";
+
+  context_t context = context_new(security_context);
+  context_type_set(context, type);
+  const int r = setcon(context_str(context));
+  context_free(context);
+  freecon(security_context);
+
+  if (r) {
+LOG(FATAL) << "dynamic transition to type '" << type << "' failed. "
+  "(this binary has been built with SELinux support, but maybe "
+  "the policies haven't been loaded into the kernel?)";
+  }
+}
+#endif  // CHROMIUM_SELINUX
+
+
+
 namespace {
 
 // NOP function. See below where this handler is installed.
diff -ru chromium-21.0.1155.2/content/zygote/zygote_linux.h chromium-21.0.1155.2.new/content/zygote/zygote_linux.h
--- chromium-21.0.1155.2/content/zygote/zygote_linux.h	2012-05-30 03:46:27.0 +0200
+++ chromium-21.0.1155.2.new/content/zygote/zygote_linux.h	2012-05-31 03:31:16.013928301 +0200
@@ -16,6 +16,8 @@
 
 namespace content {
 
+static void SELinuxTransitionToTypeOrDie(char const * type);
+
 class ZygoteForkDelegate;
 
 // This is the object which implements the zygote. The ZygoteMain function,
@@ -106,7 +108,6 @@
   int initial_uma_sample_;
   int initial_uma_boundary_value_;
 };
-
 }  // namespace content
 
 #endif  // CONTENT_ZYGOTE_ZYGOTE_H_
diff -ru chromium-21.0.1155.2/content/zygote/zygote_main_linux.cc chromium-21.0.1155.2.new/content/zygote/zygote_main_linux.cc
--- chromium-21.0.1155.2/content/zygote/zygote_main_linux.cc	2012-05-30 03:46:27.0 +0200
+++ chromium-21.0.1155.2.new/content/zygote/zygote_main_linux.cc	2012-05-31 04:04:21.383792544 +0200
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "content/zygote/zygote_linux.h"

Re: [gentoo-user] Re: ~gcc-4.7.0

2012-06-01 Thread Nilesh Govindrajan
On Jun 2, 2012 6:08 AM, "walt"  wrote:
>
> On 05/29/2012 04:54 AM, walt wrote:
>>
>> Maybe a year ago I started having problems building virtualbox on my
>> older/smaller machine.  There is one place which ran through my puny
>> 1GB of ram and then went on to fill up another 2GB of swap before
>> oomkill stepped in.
>>
>> That turned out to be a gcc bug, and a proper fix was added to gcc
>> 4.7.0 but not back-ported to 4.5.3, which I'm still using.
>>
>> Since then I scavenged half of that 1GB of RAM for my wife's machine,
>> so it should be fun to try to build virtualbox with the other half :)
>
>
> Very cool :)  I just built virtualbox with gcc-4.7.0 on my old machine
> with 0.5 GB of ram and had no problems whatever.  I also pulled from
> Linus.git and compiled his latest kernel with gcc-4.7.0, no problems.
>
> So far, so good.
>
>
>

Has anyone tried compiling chromium 20 (as of yesterday) and libreoffice
3.5.4.2 using gcc 4.7.0? I am unable to do so. Using unstable Amd64.

--
Nilesh Govindrajan
http://nileshgr.com


Re: [gentoo-user] Re: ~gcc-4.7.0

2012-05-29 Thread Stefan G. Weichinger
Am 29.05.2012 13:35, schrieb Ezequiel Garcia:

> Have anyone tried to compile linux kernels with gcc 4.7?
> Is it faster / smarter ?
> Does it shows more warnings or produce faster / smaller code or something ?

Compiled gentoo-sources-3.4.0 on ~amd64 with gcc 4.7.0.
Works.

Did no benchmarks, nothing really noticeable so far ...

Stefan




Re: [gentoo-user] Re: ~gcc-4.7.0

2012-05-29 Thread Stefan G. Weichinger
Am 29.05.2012 11:42, schrieb Nikos Chantziaras:
> On 28/05/12 23:04, Stefan G. Weichinger wrote:
>>
>> As GCC-4.7.0 appeared for ~amd64 now ...
>>
>> anyone recompiled system or world with it already?
>>
>> More advantages or disadvantages?
> 
> Since you didn't mention any specific workloads (like audio or video
> compression), I assume you're a typical desktop user (internet browsing,
> email, watching movies, listening to music, etc.)  There will be no
> differences in performance with GCC 4.7.

Yes, typical desktop/office user.
Some virtualization stuff as well (VMware player, KVM) ...

Thanks, Stefan




Re: [gentoo-user] Re: ~gcc-4.7.0

2012-05-29 Thread Ezequiel Garcia
On Tue, May 29, 2012 at 6:42 AM, Nikos Chantziaras  wrote:
> On 28/05/12 23:04, Stefan G. Weichinger wrote:
>>
>>
>> As GCC-4.7.0 appeared for ~amd64 now ...
>>
>> anyone recompiled system or world with it already?
>>
>> More advantages or disadvantages?
>
>
> Since you didn't mention any specific workloads (like audio or video
> compression), I assume you're a typical desktop user (internet browsing,
> email, watching movies, listening to music, etc.)  There will be no
> differences in performance with GCC 4.7.
>
>

Have anyone tried to compile linux kernels with gcc 4.7?
Is it faster / smarter ?
Does it shows more warnings or produce faster / smaller code or something ?