All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Yang <liezhi.yang@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH 4/5] webkitgtk: fix compile error when len(TMPDIR) == 410
Date: Thu, 30 Nov 2017 09:45:14 +0800	[thread overview]
Message-ID: <f8f2799d5b4c51969c904a7a09b75caae1020b31.1512006081.git.liezhi.yang@windriver.com> (raw)
In-Reply-To: <cover.1512006081.git.liezhi.yang@windriver.com>

One of the gcc command line was too long (longer than 160,000 characters) when
len(TMPDIR) == 410, so there was an "Argument list too long" error:
$ bitbake webkitgtk
i586-poky-linux-g++: error trying to exec [snip] execv: Argument list too long

The cmake doesn't support relative path, so we have to edit flags.make to fix
the problem:
- Replace -I${RECIPE_SYSROOT} with -I=
- Replace "-I${S}/path1/in/S -I ${S}/path2/in/S" with
  "-iprefix ${S} -iwithprefixbefore /path1/in/S -iwithprefixbefore /path2/in/S"

Now the length is less than 25,000.

[YOCTO #12362]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/recipes-sato/webkit/webkitgtk_2.16.6.bb | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/meta/recipes-sato/webkit/webkitgtk_2.16.6.bb b/meta/recipes-sato/webkit/webkitgtk_2.16.6.bb
index 0f126cb..3ff5425 100644
--- a/meta/recipes-sato/webkit/webkitgtk_2.16.6.bb
+++ b/meta/recipes-sato/webkit/webkitgtk_2.16.6.bb
@@ -117,3 +117,30 @@ ARM_INSTRUCTION_SET_armv7ve = "thumb"
 # Segmentation fault
 GI_DATA_ENABLED_armv7a = "False"
 GI_DATA_ENABLED_armv7ve = "False"
+
+do_configure[postfuncs] += 'shorter_flags_make'
+
+python shorter_flags_make() {
+    recipe_sysroot = d.getVar('RECIPE_SYSROOT')
+    for root, dirs, files in os.walk(d.getVar('B')):
+        for flags_make in files:
+            if flags_make == 'flags.make':
+                # To fix build error when len(TMPDIR) == 410:
+                # - Replace -I${RECIPE_SYSROOT} with -I=
+                # - Replace "-I${S}/path1/in/S -I ${S}/path2/in/S" with
+                #   "-iprefix ${S} -iwithprefixbefore /path1/in/S -iwithprefixbefore /path2/in/S"
+                flags_make = os.path.join(root, flags_make)
+                new_lines = []
+                with open(flags_make, 'r') as f:
+                    for line in f.readlines():
+                        if line.startswith('CXX_INCLUDES = ') or line.startswith('C_INCLUDES = '):
+                            line = line.replace('-I%s' % recipe_sysroot, '-I=')
+                            line = line.replace('CXX_INCLUDES =', 'CXX_INCLUDES = -iprefix %s/ ' % d.getVar('S'))
+                            line = line.replace('C_INCLUDES =', 'C_INCLUDES = -iprefix %s/ ' % d.getVar('S'))
+                            line = line.replace('-I%s' % d.getVar('S'), '-iwithprefixbefore ')
+                        new_lines.append(line)
+
+                with open(flags_make, 'w') as f:
+                        for line in new_lines:
+                            f.write(line)
+}
-- 
2.7.4



  parent reply	other threads:[~2017-11-30  1:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-30  1:45 [PATCH 0/5] fix build when len(TMPDIR) == 410 Robert Yang
2017-11-30  1:45 ` [PATCH 1/5] go-native: fix PATH issue " Robert Yang
2017-11-30 11:33   ` Alexander Kanavin
2017-12-01  1:40     ` Robert Yang
2017-12-01  8:25       ` Alexander Kanavin
2017-11-30  1:45 ` [PATCH 2/5] go-native: fix import error " Robert Yang
2017-11-30  1:45 ` [PATCH 3/5] ninja: fix for llvm build " Robert Yang
2017-11-30  1:45 ` Robert Yang [this message]
2017-11-30 11:34   ` [PATCH 4/5] webkitgtk: fix compile error " Alexander Kanavin
2017-12-01  1:46     ` Robert Yang
2017-12-01  8:26       ` Alexander Kanavin
2017-12-01  9:49         ` Alexander Kanavin
2017-12-04  6:16           ` Robert Yang
2017-11-30  1:45 ` [PATCH 5/5] sqlite3: use 1024 for MAX_PATHNAM Robert Yang
2018-01-09  3:09 ` [PATCH 0/5] fix build when len(TMPDIR) == 410 Robert Yang
2018-01-19  1:52 ` Robert Yang
2018-02-02  3:34 ` Robert Yang
2018-03-06  1:51 ` Robert Yang

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=f8f2799d5b4c51969c904a7a09b75caae1020b31.1512006081.git.liezhi.yang@windriver.com \
    --to=liezhi.yang@windriver.com \
    --cc=openembedded-core@lists.openembedded.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.