public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Hinnerk van Bruinehsen <h.v.bruinehsen@fu-berlin.de>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Re: ~gcc-4.7.0
Date: Sat, 02 Jun 2012 08:52:14 +0200	[thread overview]
Message-ID: <4FC9B81E.4060901@fu-berlin.de> (raw)
In-Reply-To: <CAPo3noY0wYwKvHEXNUGPLt2b=5YOqFZ=-Hee9MZaLnDM7==VgA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02.06.2012 04:37, Nilesh Govindrajan wrote:
> On Jun 2, 2012 6:08 AM, "walt" <w41ter@gmail.com> wrote:
<SNIP>
> 
> 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 <unistd.h>
#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-----

[-- Attachment #2: selinux-gcc-4.7.patch --]
[-- Type: text/x-patch, Size: 5278 bytes --]

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.000000000 +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 <pwd.h>
 
+//#if defined(OS_POSIX)
+#include <unistd.h>
+//#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.000000000 +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 <unistd.h>
+#elif defined(OS_POSIX)
+#include <unistd.h>
 #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.000000000 +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 <selinux/selinux.h>
+#include <selinux/context.h>
+#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.000000000 +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.000000000 +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"
+
 #include <dlfcn.h>
 #include <fcntl.h>
 #include <pthread.h>
@@ -48,11 +50,6 @@
 #include <signal.h>
 #endif
 
-#if defined(CHROMIUM_SELINUX)
-#include <selinux/selinux.h>
-#include <selinux/context.h>
-#endif
-
 namespace content {
 
 // See http://code.google.com/p/chromium/wiki/LinuxZygote
@@ -64,26 +61,6 @@
 // chrooted.
 static const char kSUIDSandboxVar[] = "SBX_D";
 
-#if defined(CHROMIUM_SELINUX)
-static void SELinuxTransitionToTypeOrDie(const char* 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
-
 // With SELinux we can carve out a precise sandbox, so we don't have to play
 // with intercepting libc calls.
 #if !defined(CHROMIUM_SELINUX)
diff -ru chromium-21.0.1155.2/ipc/ipc_platform_file.cc chromium-21.0.1155.2.new/ipc/ipc_platform_file.cc
--- chromium-21.0.1155.2/ipc/ipc_platform_file.cc	2012-05-30 03:46:50.000000000 +0200
+++ chromium-21.0.1155.2.new/ipc/ipc_platform_file.cc	2012-05-30 16:42:11.432999915 +0200
@@ -8,6 +8,10 @@
 #include <unistd.h>
 #endif
 
+#if defined(OS_POSIX)
+#include <unistd.h>
+#endif
+
 namespace IPC {
 
 PlatformFileForTransit GetFileHandleForProcess(base::PlatformFile handle,

[-- Attachment #3: selinux-gcc-4.7.patch.sig --]
[-- Type: application/pgp-signature, Size: 287 bytes --]

      reply	other threads:[~2012-06-02  6:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-28 20:04 [gentoo-user] ~gcc-4.7.0 Stefan G. Weichinger
2012-05-28 20:54 ` Sascha Cunz
2012-05-28 21:11   ` Stefan G. Weichinger
2012-05-29  2:19     ` Pandu Poluan
2012-05-29  2:26       ` Michael Mol
2012-05-29  8:30         ` microcai
2012-05-29 12:58           ` Michael Mol
2012-05-29 16:18             ` Volker Armin Hemmann
2012-05-29  9:42 ` [gentoo-user] ~gcc-4.7.0 Nikos Chantziaras
2012-05-29 11:35   ` Ezequiel Garcia
2012-05-29 11:58     ` Stefan G. Weichinger
2012-05-29 11:51   ` Stefan G. Weichinger
2012-05-29 10:13 ` [gentoo-user] ~gcc-4.7.0 Andrey Moshbear
2012-05-29 10:26 ` Hinnerk van Bruinehsen
2012-05-29 13:01   ` Adam Carter
2012-05-29 14:11   ` Michael Orlitzky
2012-05-29 11:54 ` [gentoo-user] ~gcc-4.7.0 walt
2012-06-02  0:36   ` walt
2012-06-02  2:37     ` Nilesh Govindrajan
2012-06-02  6:52       ` Hinnerk van Bruinehsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FC9B81E.4060901@fu-berlin.de \
    --to=h.v.bruinehsen@fu-berlin.de \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox