All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] fix build when len(TMPDIR) == 410
@ 2017-11-30  1:45 Robert Yang
  2017-11-30  1:45 ` [PATCH 1/5] go-native: fix PATH issue " Robert Yang
                   ` (8 more replies)
  0 siblings, 9 replies; 18+ messages in thread
From: Robert Yang @ 2017-11-30  1:45 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 33418ed064fe9cff5b4803f09135a81d9170c189:

  runqemu: Also specialcase resolution of '.' to the file's location (2017-11-21 17:58:36 +0000)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib rbt/long
  http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/long

Robert Yang (5):
  go-native: fix PATH issue when len(TMPDIR) == 410
  go-native: fix import error when len(TMPDIR) == 410
  ninja: fix for llvm build when len(TMPDIR) == 410
  webkitgtk: fix compile error when len(TMPDIR) == 410
  sqlite3: use 1024 for MAX_PATHNAM

 ...01-cmd-dist-unix.c-bprintf-use-larger-buf.patch | 38 ++++++++++++++++++++++
 .../go/files/0002-cmd-gc-go.h-NSYMB-500-1000.patch | 35 ++++++++++++++++++++
 meta/recipes-devtools/go/go-native.inc             |  5 ++-
 ...src-util.cc-use-larger-kMaxPathComponents.patch | 33 +++++++++++++++++++
 meta/recipes-devtools/ninja/ninja_1.7.2.bb         |  5 ++-
 meta/recipes-sato/webkit/webkitgtk_2.16.6.bb       | 27 +++++++++++++++
 .../0001-sqlite3.c-use-1024-MAX_PATHNAME.patch     | 37 +++++++++++++++++++++
 meta/recipes-support/sqlite/sqlite3_3.21.0.bb      |  1 +
 8 files changed, 179 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/go/files/0001-cmd-dist-unix.c-bprintf-use-larger-buf.patch
 create mode 100644 meta/recipes-devtools/go/files/0002-cmd-gc-go.h-NSYMB-500-1000.patch
 create mode 100644 meta/recipes-devtools/ninja/ninja/0001-src-util.cc-use-larger-kMaxPathComponents.patch
 create mode 100644 meta/recipes-support/sqlite/files/0001-sqlite3.c-use-1024-MAX_PATHNAME.patch

-- 
2.7.4



^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/5] go-native: fix PATH issue when len(TMPDIR) == 410
  2017-11-30  1:45 [PATCH 0/5] fix build when len(TMPDIR) == 410 Robert Yang
@ 2017-11-30  1:45 ` Robert Yang
  2017-11-30 11:33   ` Alexander Kanavin
  2017-11-30  1:45 ` [PATCH 2/5] go-native: fix import error " Robert Yang
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Robert Yang @ 2017-11-30  1:45 UTC (permalink / raw)
  To: openembedded-core

The buf is used for saving PATH, 4096 is a little small when building in deep
path, for example, it would be failed when oe-coe's len(TMPDIR) == 410, use
8192 can fix the problem.

Fixed:
$ bitbake go-native
[snip]
gcc -isystem/workspace2/lyang1/aaaaaaaa/[snip]
exec gcc: No such file or directory
[snip]

Only go-native needs this patch since only it uses go1.4 which has unix.c.

[YOCTO #11351]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 ...01-cmd-dist-unix.c-bprintf-use-larger-buf.patch | 38 ++++++++++++++++++++++
 meta/recipes-devtools/go/go-native.inc             |  4 ++-
 2 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/go/files/0001-cmd-dist-unix.c-bprintf-use-larger-buf.patch

diff --git a/meta/recipes-devtools/go/files/0001-cmd-dist-unix.c-bprintf-use-larger-buf.patch b/meta/recipes-devtools/go/files/0001-cmd-dist-unix.c-bprintf-use-larger-buf.patch
new file mode 100644
index 0000000..82c1fc1
--- /dev/null
+++ b/meta/recipes-devtools/go/files/0001-cmd-dist-unix.c-bprintf-use-larger-buf.patch
@@ -0,0 +1,38 @@
+From 443724ac952aa9b7550dc89ac14dbea1c2cd05b0 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 15 Nov 2017 10:49:03 +0800
+Subject: [PATCH] cmd/dist/unix.c: bprintf(): use larger buf
+
+The buf is used for saving PATH, 4096 is a little small when building in deep
+path, for example, it would be failed when oe-coe's len(TMPDIR) == 410, use
+8192 can fix the problem.
+
+Fixed:
+[snip]
+gcc -isystem/workspace2/lyang1/aaaaaaaa/[snip]
+exec gcc: No such file or directory
+[snip]
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ go/src/cmd/dist/unix.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/go/src/cmd/dist/unix.c b/go/src/cmd/dist/unix.c
+index 4a78684..fa41964 100644
+--- a/go/src/cmd/dist/unix.c
++++ b/go/src/cmd/dist/unix.c
+@@ -32,7 +32,7 @@ char*
+ bprintf(Buf *b, char *fmt, ...)
+ {
+ 	va_list arg;
+-	char buf[4096];
++	char buf[8192];
+ 	
+ 	breset(b);
+ 	va_start(arg, fmt);
+-- 
+2.7.4
+
diff --git a/meta/recipes-devtools/go/go-native.inc b/meta/recipes-devtools/go/go-native.inc
index 95db1c2..0791b6d 100644
--- a/meta/recipes-devtools/go/go-native.inc
+++ b/meta/recipes-devtools/go/go-native.inc
@@ -4,7 +4,9 @@ nonstaging_libdir := "${libdir}"
 
 inherit native
 
-SRC_URI_append = " http://golang.org/dl/go1.4.3.src.tar.gz;name=bootstrap;subdir=go1.4"
+SRC_URI_append = " http://golang.org/dl/go1.4.3.src.tar.gz;name=bootstrap;subdir=go1.4 \
+                   file://0001-cmd-dist-unix.c-bprintf-use-larger-buf.patch;patchdir=../go1.4 \
+"
 SRC_URI[bootstrap.md5sum] = "dfb604511115dd402a77a553a5923a04"
 SRC_URI[bootstrap.sha256sum] = "9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959"
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/5] go-native: fix import error when len(TMPDIR) == 410
  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  1:45 ` Robert Yang
  2017-11-30  1:45 ` [PATCH 3/5] ninja: fix for llvm build " Robert Yang
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 18+ messages in thread
From: Robert Yang @ 2017-11-30  1:45 UTC (permalink / raw)
  To: openembedded-core

It is used for saving file path, 500 is a little small when building in deep
path, for example, it would be failed when oe-coe's len(TMPDIR) == 410, use
1000 can fix the problem.

Fixed:
$ bitbake go-native
[snip]
gcc -isystem/workspace2/lyang1/aaaaaaaa/[snip]
exec gcc: No such file or directory
[snip]

Only go-native needs this patch since only it uses go1.4 which has src/cmd/gc/go.h.

[YOCTO #11351]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 .../go/files/0002-cmd-gc-go.h-NSYMB-500-1000.patch | 35 ++++++++++++++++++++++
 meta/recipes-devtools/go/go-native.inc             |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 meta/recipes-devtools/go/files/0002-cmd-gc-go.h-NSYMB-500-1000.patch

diff --git a/meta/recipes-devtools/go/files/0002-cmd-gc-go.h-NSYMB-500-1000.patch b/meta/recipes-devtools/go/files/0002-cmd-gc-go.h-NSYMB-500-1000.patch
new file mode 100644
index 0000000..73aff0c
--- /dev/null
+++ b/meta/recipes-devtools/go/files/0002-cmd-gc-go.h-NSYMB-500-1000.patch
@@ -0,0 +1,35 @@
+From 7228802277fa97bf3b3988eeef1ff5b8e97ab082 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 15 Nov 2017 14:23:48 +0800
+Subject: [PATCH] cmd/gc/go.h: NSYMB: 500 -> 1000
+
+It is used for saving file path, 500 is a little small when building in deep
+path, for example, it would be failed when oe-coe's len(TMPDIR) == 410, use
+1000 can fix the problem.
+
+Fixed:
+cmd/internal/objfile/disasm.go:18: can't find import: "cmd/internal/rsc.io/arm/armasm"
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ go/src/cmd/gc/go.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/go/src/cmd/gc/go.h b/go/src/cmd/gc/go.h
+index bbb8835..caa326c 100644
+--- a/go/src/cmd/gc/go.h
++++ b/go/src/cmd/gc/go.h
+@@ -27,7 +27,7 @@ enum
+ {
+ 	NHUNK		= 50000,
+ 	BUFSIZ		= 8192,
+-	NSYMB		= 500,
++	NSYMB		= 1000,
+ 	NHASH		= 1024,
+ 	STRINGSZ	= 200,
+ 	MAXALIGN	= 7,
+-- 
+2.7.4
+
diff --git a/meta/recipes-devtools/go/go-native.inc b/meta/recipes-devtools/go/go-native.inc
index 0791b6d..43426c0 100644
--- a/meta/recipes-devtools/go/go-native.inc
+++ b/meta/recipes-devtools/go/go-native.inc
@@ -6,6 +6,7 @@ inherit native
 
 SRC_URI_append = " http://golang.org/dl/go1.4.3.src.tar.gz;name=bootstrap;subdir=go1.4 \
                    file://0001-cmd-dist-unix.c-bprintf-use-larger-buf.patch;patchdir=../go1.4 \
+                   file://0002-cmd-gc-go.h-NSYMB-500-1000.patch;patchdir=../go1.4 \
 "
 SRC_URI[bootstrap.md5sum] = "dfb604511115dd402a77a553a5923a04"
 SRC_URI[bootstrap.sha256sum] = "9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 3/5] ninja: fix for llvm build when len(TMPDIR) == 410
  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  1:45 ` [PATCH 2/5] go-native: fix import error " Robert Yang
@ 2017-11-30  1:45 ` Robert Yang
  2017-11-30  1:45 ` [PATCH 4/5] webkitgtk: fix compile error " Robert Yang
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 18+ messages in thread
From: Robert Yang @ 2017-11-30  1:45 UTC (permalink / raw)
  To: openembedded-core

It is used for saving path components, 30 is a little small, use 100.

Fixed when build llvm:
ninja: fatal: path has too many components

[YOCTO #12347]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 ...src-util.cc-use-larger-kMaxPathComponents.patch | 33 ++++++++++++++++++++++
 meta/recipes-devtools/ninja/ninja_1.7.2.bb         |  5 +++-
 2 files changed, 37 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/ninja/ninja/0001-src-util.cc-use-larger-kMaxPathComponents.patch

diff --git a/meta/recipes-devtools/ninja/ninja/0001-src-util.cc-use-larger-kMaxPathComponents.patch b/meta/recipes-devtools/ninja/ninja/0001-src-util.cc-use-larger-kMaxPathComponents.patch
new file mode 100644
index 0000000..64cac7b
--- /dev/null
+++ b/meta/recipes-devtools/ninja/ninja/0001-src-util.cc-use-larger-kMaxPathComponents.patch
@@ -0,0 +1,33 @@
+From 04534ec915e08f59b66bf6044290faeea4610394 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 15 Nov 2017 16:01:01 +0800
+Subject: [PATCH] src/util.cc: use larger kMaxPathComponents
+
+It is used for saving path components, 30 is a little small, use 100.
+
+Fixed when build llvm:
+ninja: fatal: path has too many components
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ src/util.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/util.cc b/src/util.cc
+index e31fd1f..f84a12e 100644
+--- a/src/util.cc
++++ b/src/util.cc
+@@ -125,7 +125,7 @@ bool CanonicalizePath(char* path, size_t* len, unsigned int* slash_bits,
+     return false;
+   }
+ 
+-  const int kMaxPathComponents = 30;
++  const int kMaxPathComponents = 100;
+   char* components[kMaxPathComponents];
+   int component_count = 0;
+ 
+-- 
+2.7.4
+
diff --git a/meta/recipes-devtools/ninja/ninja_1.7.2.bb b/meta/recipes-devtools/ninja/ninja_1.7.2.bb
index 4d3b272..0ef2ea0 100644
--- a/meta/recipes-devtools/ninja/ninja_1.7.2.bb
+++ b/meta/recipes-devtools/ninja/ninja_1.7.2.bb
@@ -7,7 +7,10 @@ DEPENDS = "re2c-native ninja-native"
 
 SRCREV = "717b7b4a31db6027207588c0fb89c3ead384747b"
 
-SRC_URI = "git://github.com/martine/ninja.git;branch=release"
+SRC_URI = "git://github.com/martine/ninja.git;branch=release \
+           file://0001-src-util.cc-use-larger-kMaxPathComponents.patch \
+"
+
 UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>.*)"
 
 S = "${WORKDIR}/git"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 4/5] webkitgtk: fix compile error when len(TMPDIR) == 410
  2017-11-30  1:45 [PATCH 0/5] fix build when len(TMPDIR) == 410 Robert Yang
                   ` (2 preceding siblings ...)
  2017-11-30  1:45 ` [PATCH 3/5] ninja: fix for llvm build " Robert Yang
@ 2017-11-30  1:45 ` Robert Yang
  2017-11-30 11:34   ` Alexander Kanavin
  2017-11-30  1:45 ` [PATCH 5/5] sqlite3: use 1024 for MAX_PATHNAM Robert Yang
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Robert Yang @ 2017-11-30  1:45 UTC (permalink / raw)
  To: openembedded-core

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



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 5/5] sqlite3: use 1024 for MAX_PATHNAM
  2017-11-30  1:45 [PATCH 0/5] fix build when len(TMPDIR) == 410 Robert Yang
                   ` (3 preceding siblings ...)
  2017-11-30  1:45 ` [PATCH 4/5] webkitgtk: fix compile error " Robert Yang
@ 2017-11-30  1:45 ` Robert Yang
  2018-01-09  3:09 ` [PATCH 0/5] fix build when len(TMPDIR) == 410 Robert Yang
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 18+ messages in thread
From: Robert Yang @ 2017-11-30  1:45 UTC (permalink / raw)
  To: openembedded-core

The 512 is a little small when len(TMPDIR) == 410, it would be failed when
do_rootfs, use 1024 to fix problem:

Fixed when len(TMPDIR) == 410:
$ bitbake core-image-minimal
[snip]
"tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot-native/usr/lib/python3.5/site-packages/dnf/yum/history.py", line 799, in _get_cursor
    self._conn = sqlite.connect(self._db_file)
sqlite3.OperationalError: unable to open database file

[YOCTO #12374]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 .../0001-sqlite3.c-use-1024-MAX_PATHNAME.patch     | 37 ++++++++++++++++++++++
 meta/recipes-support/sqlite/sqlite3_3.21.0.bb      |  1 +
 2 files changed, 38 insertions(+)
 create mode 100644 meta/recipes-support/sqlite/files/0001-sqlite3.c-use-1024-MAX_PATHNAME.patch

diff --git a/meta/recipes-support/sqlite/files/0001-sqlite3.c-use-1024-MAX_PATHNAME.patch b/meta/recipes-support/sqlite/files/0001-sqlite3.c-use-1024-MAX_PATHNAME.patch
new file mode 100644
index 0000000..f000477
--- /dev/null
+++ b/meta/recipes-support/sqlite/files/0001-sqlite3.c-use-1024-MAX_PATHNAME.patch
@@ -0,0 +1,37 @@
+From 9f63bdd623a851c6f4af6d1259161d5d47d94bb3 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 22 Nov 2017 15:23:24 +0800
+Subject: [PATCH] sqlite3.c: use 1024 for MAX_PATHNAME
+
+The 512 is a little small when build in deep directory, e.g., it would be
+failed to run when oe-core's TMPDIR == 410, use 1024 to fix problem.
+
+Fixed:
+[snip]
+"/usr/lib/python3.5/site-packages/dnf/yum/history.py", line 799, in _get_cursor
+    self._conn = sqlite.connect(self._db_file)
+sqlite3.OperationalError: unable to open database file
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ sqlite3.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sqlite3.c b/sqlite3.c
+index 4ec1271..31edaf8 100644
+--- a/sqlite3.c
++++ b/sqlite3.c
+@@ -30379,7 +30379,7 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
+ /*
+ ** Maximum supported path-length.
+ */
+-#define MAX_PATHNAME 512
++#define MAX_PATHNAME 1024
+ 
+ /*
+ ** Maximum supported symbolic links
+-- 
+2.7.4
+
diff --git a/meta/recipes-support/sqlite/sqlite3_3.21.0.bb b/meta/recipes-support/sqlite/sqlite3_3.21.0.bb
index 1d51733..33f41e5 100644
--- a/meta/recipes-support/sqlite/sqlite3_3.21.0.bb
+++ b/meta/recipes-support/sqlite/sqlite3_3.21.0.bb
@@ -5,6 +5,7 @@ LIC_FILES_CHKSUM = "file://sqlite3.h;endline=11;md5=786d3dc581eff03f4fd9e4a77ed0
 
 SRC_URI = "\
   http://www.sqlite.org/2017/sqlite-autoconf-${SQLITE_PV}.tar.gz \
+  file://0001-sqlite3.c-use-1024-MAX_PATHNAME.patch \
   "
 SRC_URI[md5sum] = "7913de4c3126ba3c24689cb7a199ea31"
 SRC_URI[sha256sum] = "d7dd516775005ad87a57f428b6f86afd206cb341722927f104d3f0cf65fbbbe3"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/5] go-native: fix PATH issue when len(TMPDIR) == 410
  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
  0 siblings, 1 reply; 18+ messages in thread
From: Alexander Kanavin @ 2017-11-30 11:33 UTC (permalink / raw)
  To: Robert Yang, openembedded-core

On 11/30/2017 03:45 AM, Robert Yang wrote:
> +-	char buf[4096];
> ++	char buf[8192];

I understand it would take more time, but the proper way to fix this 
(and similar issues in patches 2, 3, 5) is to use dynamic allocation. 
Swapping one arbitrary value for another arbitrary value may still not 
be enough for everyone.

Alex


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/5] webkitgtk: fix compile error when len(TMPDIR) == 410
  2017-11-30  1:45 ` [PATCH 4/5] webkitgtk: fix compile error " Robert Yang
@ 2017-11-30 11:34   ` Alexander Kanavin
  2017-12-01  1:46     ` Robert Yang
  0 siblings, 1 reply; 18+ messages in thread
From: Alexander Kanavin @ 2017-11-30 11:34 UTC (permalink / raw)
  To: openembedded-core, liezhi.yang@windriver.com >> Robert Yang

On 11/30/2017 03:45 AM, Robert Yang wrote:
> 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"

Where does flags.make come from? Can you fix the problem at the source, 
rather than patch the file with a custom, unwieldy function after the fact?

Alex


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/5] go-native: fix PATH issue when len(TMPDIR) == 410
  2017-11-30 11:33   ` Alexander Kanavin
@ 2017-12-01  1:40     ` Robert Yang
  2017-12-01  8:25       ` Alexander Kanavin
  0 siblings, 1 reply; 18+ messages in thread
From: Robert Yang @ 2017-12-01  1:40 UTC (permalink / raw)
  To: Alexander Kanavin, openembedded-core

Hi Alexander,

On 11/30/2017 07:33 PM, Alexander Kanavin wrote:
> On 11/30/2017 03:45 AM, Robert Yang wrote:
>> +-    char buf[4096];
>> ++    char buf[8192];
> 
> I understand it would take more time, but the proper way to fix this (and 
> similar issues in patches 2, 3, 5) is to use dynamic allocation. Swapping one 
> arbitrary value for another arbitrary value may still not be enough for everyone.

There are two reasons that it isn't worth to use dynamic allocation (e.g., malloc):
1) The path length has a limit defined in /usr/include/linux/limits.h,
    usually it is 4096, but a lot of tools would be failed (include python IIRC)
    when len(tmpdir) > 410 (then len(path) is about 500 since it is in workdir)
    in our testing, so make it work when len(tmp) == 410 should be enough for
    everyone in the real world, otherwise, other errors will happen.

2) Look at the context of go/src/cmd/dist/unix.c:

char*
bprintf(Buf *b, char *fmt, ...)
{
     va_list arg;
     char buf[4096];

     breset(b);
     va_start(arg, fmt);
     vsnprintf(buf, sizeof buf, fmt, arg);
[snip]

There is no easy way to know how much memory is needed, we need some ways look 
tricky which makes the code complex: (fake code)

if (length = vsnprintf(NULL, 0, fmt, arg)) >= 0) {
	char *buf = (char*) malloc(length + 1);
	if (buf){
		va_start(arg, fmt);
		vsnprintf(buf, length + 1, fmt, arg);
		[snip]
		free(buf)
	}
}

So I don't think that it is worth to use malloc here, the similar to 2 3 5.
And we had used a few similar ways to fix this kinds of issues before.

// Robert

> 
> Alex
> 


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/5] webkitgtk: fix compile error when len(TMPDIR) == 410
  2017-11-30 11:34   ` Alexander Kanavin
@ 2017-12-01  1:46     ` Robert Yang
  2017-12-01  8:26       ` Alexander Kanavin
  0 siblings, 1 reply; 18+ messages in thread
From: Robert Yang @ 2017-12-01  1:46 UTC (permalink / raw)
  To: Alexander Kanavin, openembedded-core

Hi Alexander,

On 11/30/2017 07:34 PM, Alexander Kanavin wrote:
> On 11/30/2017 03:45 AM, Robert Yang wrote:
>> 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"
> 
> Where does flags.make come from? Can you fix the problem at the source, rather 
> than patch the file with a custom, unwieldy function after the fact?

The flags.make is generated by cmake, and as I said in the commit message:

"The cmake doesn't support relative path, so we have to edit flags.make to fix
the problem"

I'm not familiar with cmake, please let me know if there is a way to make
it generate a relative path in flags.make.

// Robert

> 
> Alex
> 


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/5] go-native: fix PATH issue when len(TMPDIR) == 410
  2017-12-01  1:40     ` Robert Yang
@ 2017-12-01  8:25       ` Alexander Kanavin
  0 siblings, 0 replies; 18+ messages in thread
From: Alexander Kanavin @ 2017-12-01  8:25 UTC (permalink / raw)
  To: Robert Yang, openembedded-core

On 12/01/2017 03:40 AM, Robert Yang wrote:
> So I don't think that it is worth to use malloc here, the similar to 2 3 5.
> And we had used a few similar ways to fix this kinds of issues before.

Okay, that's fair. If there is an upper limit defined somewhere else 
(kernel, glibc) and upstream doesn't mind taking the fix, then I'm fine 
with it.


Alex


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/5] webkitgtk: fix compile error when len(TMPDIR) == 410
  2017-12-01  1:46     ` Robert Yang
@ 2017-12-01  8:26       ` Alexander Kanavin
  2017-12-01  9:49         ` Alexander Kanavin
  0 siblings, 1 reply; 18+ messages in thread
From: Alexander Kanavin @ 2017-12-01  8:26 UTC (permalink / raw)
  To: Robert Yang, openembedded-core

On 12/01/2017 03:46 AM, Robert Yang wrote:
> The flags.make is generated by cmake, and as I said in the commit message:
> 
> "The cmake doesn't support relative path, so we have to edit flags.make 
> to fix
> the problem"
> 
> I'm not familiar with cmake, please let me know if there is a way to make
> it generate a relative path in flags.make.

I'll try to find out how it happens, and will get back to you.

Alex


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/5] webkitgtk: fix compile error when len(TMPDIR) == 410
  2017-12-01  8:26       ` Alexander Kanavin
@ 2017-12-01  9:49         ` Alexander Kanavin
  2017-12-04  6:16           ` Robert Yang
  0 siblings, 1 reply; 18+ messages in thread
From: Alexander Kanavin @ 2017-12-01  9:49 UTC (permalink / raw)
  To: Robert Yang, openembedded-core

On 12/01/2017 10:26 AM, Alexander Kanavin wrote:
> On 12/01/2017 03:46 AM, Robert Yang wrote:
>> The flags.make is generated by cmake, and as I said in the commit 
>> message:
>>
>> "The cmake doesn't support relative path, so we have to edit 
>> flags.make to fix
>> the problem"
>>
>> I'm not familiar with cmake, please let me know if there is a way to make
>> it generate a relative path in flags.make.
> 
> I'll try to find out how it happens, and will get back to you.

Sadly, looks like you are right. Cmake will prepend a full path to every 
include directory, even if they're specified as relative in CmakeLists.txt.

As this is a common problem, should it go to cmake.bbclass perhaps?


Alex


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/5] webkitgtk: fix compile error when len(TMPDIR) == 410
  2017-12-01  9:49         ` Alexander Kanavin
@ 2017-12-04  6:16           ` Robert Yang
  0 siblings, 0 replies; 18+ messages in thread
From: Robert Yang @ 2017-12-04  6:16 UTC (permalink / raw)
  To: Alexander Kanavin, openembedded-core

Hi Alexander,

On 12/01/2017 05:49 PM, Alexander Kanavin wrote:
> On 12/01/2017 10:26 AM, Alexander Kanavin wrote:
>> On 12/01/2017 03:46 AM, Robert Yang wrote:
>>> The flags.make is generated by cmake, and as I said in the commit message:
>>>
>>> "The cmake doesn't support relative path, so we have to edit flags.make to fix
>>> the problem"
>>>
>>> I'm not familiar with cmake, please let me know if there is a way to make
>>> it generate a relative path in flags.make.
>>
>> I'll try to find out how it happens, and will get back to you.
> 
> Sadly, looks like you are right. Cmake will prepend a full path to every include 
> directory, even if they're specified as relative in CmakeLists.txt.
> 
> As this is a common problem, should it go to cmake.bbclass perhaps?
I didn't find other cmake recipes have build errors when len(TMPDIR) == 410,
so I'm leaning to not add to cmake.bbclass.

// Robert

> 
> 
> Alex
> 


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/5] fix build when len(TMPDIR) == 410
  2017-11-30  1:45 [PATCH 0/5] fix build when len(TMPDIR) == 410 Robert Yang
                   ` (4 preceding siblings ...)
  2017-11-30  1:45 ` [PATCH 5/5] sqlite3: use 1024 for MAX_PATHNAM Robert Yang
@ 2018-01-09  3:09 ` Robert Yang
  2018-01-19  1:52 ` Robert Yang
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 18+ messages in thread
From: Robert Yang @ 2018-01-09  3:09 UTC (permalink / raw)
  To: openembedded-core

Ping.

// Robert

On 11/30/2017 09:45 AM, Robert Yang wrote:
> The following changes since commit 33418ed064fe9cff5b4803f09135a81d9170c189:
> 
>    runqemu: Also specialcase resolution of '.' to the file's location (2017-11-21 17:58:36 +0000)
> 
> are available in the git repository at:
> 
>    git://git.openembedded.org/openembedded-core-contrib rbt/long
>    http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/long
> 
> Robert Yang (5):
>    go-native: fix PATH issue when len(TMPDIR) == 410
>    go-native: fix import error when len(TMPDIR) == 410
>    ninja: fix for llvm build when len(TMPDIR) == 410
>    webkitgtk: fix compile error when len(TMPDIR) == 410
>    sqlite3: use 1024 for MAX_PATHNAM
> 
>   ...01-cmd-dist-unix.c-bprintf-use-larger-buf.patch | 38 ++++++++++++++++++++++
>   .../go/files/0002-cmd-gc-go.h-NSYMB-500-1000.patch | 35 ++++++++++++++++++++
>   meta/recipes-devtools/go/go-native.inc             |  5 ++-
>   ...src-util.cc-use-larger-kMaxPathComponents.patch | 33 +++++++++++++++++++
>   meta/recipes-devtools/ninja/ninja_1.7.2.bb         |  5 ++-
>   meta/recipes-sato/webkit/webkitgtk_2.16.6.bb       | 27 +++++++++++++++
>   .../0001-sqlite3.c-use-1024-MAX_PATHNAME.patch     | 37 +++++++++++++++++++++
>   meta/recipes-support/sqlite/sqlite3_3.21.0.bb      |  1 +
>   8 files changed, 179 insertions(+), 2 deletions(-)
>   create mode 100644 meta/recipes-devtools/go/files/0001-cmd-dist-unix.c-bprintf-use-larger-buf.patch
>   create mode 100644 meta/recipes-devtools/go/files/0002-cmd-gc-go.h-NSYMB-500-1000.patch
>   create mode 100644 meta/recipes-devtools/ninja/ninja/0001-src-util.cc-use-larger-kMaxPathComponents.patch
>   create mode 100644 meta/recipes-support/sqlite/files/0001-sqlite3.c-use-1024-MAX_PATHNAME.patch
> 


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/5] fix build when len(TMPDIR) == 410
  2017-11-30  1:45 [PATCH 0/5] fix build when len(TMPDIR) == 410 Robert Yang
                   ` (5 preceding siblings ...)
  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
  8 siblings, 0 replies; 18+ messages in thread
From: Robert Yang @ 2018-01-19  1:52 UTC (permalink / raw)
  To: openembedded-core

ping.

// Robert

On 11/30/2017 09:45 AM, Robert Yang wrote:
> The following changes since commit 33418ed064fe9cff5b4803f09135a81d9170c189:
> 
>    runqemu: Also specialcase resolution of '.' to the file's location (2017-11-21 17:58:36 +0000)
> 
> are available in the git repository at:
> 
>    git://git.openembedded.org/openembedded-core-contrib rbt/long
>    http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/long
> 
> Robert Yang (5):
>    go-native: fix PATH issue when len(TMPDIR) == 410
>    go-native: fix import error when len(TMPDIR) == 410
>    ninja: fix for llvm build when len(TMPDIR) == 410
>    webkitgtk: fix compile error when len(TMPDIR) == 410
>    sqlite3: use 1024 for MAX_PATHNAM
> 
>   ...01-cmd-dist-unix.c-bprintf-use-larger-buf.patch | 38 ++++++++++++++++++++++
>   .../go/files/0002-cmd-gc-go.h-NSYMB-500-1000.patch | 35 ++++++++++++++++++++
>   meta/recipes-devtools/go/go-native.inc             |  5 ++-
>   ...src-util.cc-use-larger-kMaxPathComponents.patch | 33 +++++++++++++++++++
>   meta/recipes-devtools/ninja/ninja_1.7.2.bb         |  5 ++-
>   meta/recipes-sato/webkit/webkitgtk_2.16.6.bb       | 27 +++++++++++++++
>   .../0001-sqlite3.c-use-1024-MAX_PATHNAME.patch     | 37 +++++++++++++++++++++
>   meta/recipes-support/sqlite/sqlite3_3.21.0.bb      |  1 +
>   8 files changed, 179 insertions(+), 2 deletions(-)
>   create mode 100644 meta/recipes-devtools/go/files/0001-cmd-dist-unix.c-bprintf-use-larger-buf.patch
>   create mode 100644 meta/recipes-devtools/go/files/0002-cmd-gc-go.h-NSYMB-500-1000.patch
>   create mode 100644 meta/recipes-devtools/ninja/ninja/0001-src-util.cc-use-larger-kMaxPathComponents.patch
>   create mode 100644 meta/recipes-support/sqlite/files/0001-sqlite3.c-use-1024-MAX_PATHNAME.patch
> 


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/5] fix build when len(TMPDIR) == 410
  2017-11-30  1:45 [PATCH 0/5] fix build when len(TMPDIR) == 410 Robert Yang
                   ` (6 preceding siblings ...)
  2018-01-19  1:52 ` Robert Yang
@ 2018-02-02  3:34 ` Robert Yang
  2018-03-06  1:51 ` Robert Yang
  8 siblings, 0 replies; 18+ messages in thread
From: Robert Yang @ 2018-02-02  3:34 UTC (permalink / raw)
  To: openembedded-core

Ping.

// Robert

On 11/30/2017 09:45 AM, Robert Yang wrote:
> The following changes since commit 33418ed064fe9cff5b4803f09135a81d9170c189:
> 
>    runqemu: Also specialcase resolution of '.' to the file's location (2017-11-21 17:58:36 +0000)
> 
> are available in the git repository at:
> 
>    git://git.openembedded.org/openembedded-core-contrib rbt/long
>    http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/long
> 
> Robert Yang (5):
>    go-native: fix PATH issue when len(TMPDIR) == 410
>    go-native: fix import error when len(TMPDIR) == 410
>    ninja: fix for llvm build when len(TMPDIR) == 410
>    webkitgtk: fix compile error when len(TMPDIR) == 410
>    sqlite3: use 1024 for MAX_PATHNAM
> 
>   ...01-cmd-dist-unix.c-bprintf-use-larger-buf.patch | 38 ++++++++++++++++++++++
>   .../go/files/0002-cmd-gc-go.h-NSYMB-500-1000.patch | 35 ++++++++++++++++++++
>   meta/recipes-devtools/go/go-native.inc             |  5 ++-
>   ...src-util.cc-use-larger-kMaxPathComponents.patch | 33 +++++++++++++++++++
>   meta/recipes-devtools/ninja/ninja_1.7.2.bb         |  5 ++-
>   meta/recipes-sato/webkit/webkitgtk_2.16.6.bb       | 27 +++++++++++++++
>   .../0001-sqlite3.c-use-1024-MAX_PATHNAME.patch     | 37 +++++++++++++++++++++
>   meta/recipes-support/sqlite/sqlite3_3.21.0.bb      |  1 +
>   8 files changed, 179 insertions(+), 2 deletions(-)
>   create mode 100644 meta/recipes-devtools/go/files/0001-cmd-dist-unix.c-bprintf-use-larger-buf.patch
>   create mode 100644 meta/recipes-devtools/go/files/0002-cmd-gc-go.h-NSYMB-500-1000.patch
>   create mode 100644 meta/recipes-devtools/ninja/ninja/0001-src-util.cc-use-larger-kMaxPathComponents.patch
>   create mode 100644 meta/recipes-support/sqlite/files/0001-sqlite3.c-use-1024-MAX_PATHNAME.patch
> 


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/5] fix build when len(TMPDIR) == 410
  2017-11-30  1:45 [PATCH 0/5] fix build when len(TMPDIR) == 410 Robert Yang
                   ` (7 preceding siblings ...)
  2018-02-02  3:34 ` Robert Yang
@ 2018-03-06  1:51 ` Robert Yang
  8 siblings, 0 replies; 18+ messages in thread
From: Robert Yang @ 2018-03-06  1:51 UTC (permalink / raw)
  To: openembedded-core, Burton, Ross, Richard Purdie

Ping.

// Robert

On 11/30/2017 09:45 AM, Robert Yang wrote:
> The following changes since commit 33418ed064fe9cff5b4803f09135a81d9170c189:
> 
>    runqemu: Also specialcase resolution of '.' to the file's location (2017-11-21 17:58:36 +0000)
> 
> are available in the git repository at:
> 
>    git://git.openembedded.org/openembedded-core-contrib rbt/long
>    http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/long
> 
> Robert Yang (5):
>    go-native: fix PATH issue when len(TMPDIR) == 410
>    go-native: fix import error when len(TMPDIR) == 410
>    ninja: fix for llvm build when len(TMPDIR) == 410
>    webkitgtk: fix compile error when len(TMPDIR) == 410
>    sqlite3: use 1024 for MAX_PATHNAM
> 
>   ...01-cmd-dist-unix.c-bprintf-use-larger-buf.patch | 38 ++++++++++++++++++++++
>   .../go/files/0002-cmd-gc-go.h-NSYMB-500-1000.patch | 35 ++++++++++++++++++++
>   meta/recipes-devtools/go/go-native.inc             |  5 ++-
>   ...src-util.cc-use-larger-kMaxPathComponents.patch | 33 +++++++++++++++++++
>   meta/recipes-devtools/ninja/ninja_1.7.2.bb         |  5 ++-
>   meta/recipes-sato/webkit/webkitgtk_2.16.6.bb       | 27 +++++++++++++++
>   .../0001-sqlite3.c-use-1024-MAX_PATHNAME.patch     | 37 +++++++++++++++++++++
>   meta/recipes-support/sqlite/sqlite3_3.21.0.bb      |  1 +
>   8 files changed, 179 insertions(+), 2 deletions(-)
>   create mode 100644 meta/recipes-devtools/go/files/0001-cmd-dist-unix.c-bprintf-use-larger-buf.patch
>   create mode 100644 meta/recipes-devtools/go/files/0002-cmd-gc-go.h-NSYMB-500-1000.patch
>   create mode 100644 meta/recipes-devtools/ninja/ninja/0001-src-util.cc-use-larger-kMaxPathComponents.patch
>   create mode 100644 meta/recipes-support/sqlite/files/0001-sqlite3.c-use-1024-MAX_PATHNAME.patch
> 


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2018-03-06  1:50 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 4/5] webkitgtk: fix compile error " Robert Yang
2017-11-30 11:34   ` 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

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.