rgbkrk / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

CFLAGS & gyp/make #123

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When i do this on an ubuntu x64 builder:

GYP_GENERATORS=make GYP_DEFINES="werror= target_arch=x64 no_strict_aliasing=1 
gcc_version=44 use_system_ffmpeg=1 
use_system_bzip2=1 use_system_zlib=0 use_system_libjpeg=1 use_system_libpng=1 
use_system_sqlite=0 use_system_libxml=1 
use_system_libxslt=1  
linux_sandbox_path=/usr/lib/chromium-browser/chromium-browser-sandbox 
linux_sandbox_chrome_path=/usr/lib/chromium-browser/chromium-browser " python 
build/gyp_chromium build/all.gyp

i.e., the same line I've been using for months for the Ubuntu builds but with 
the additional GYP_GENERATORS=make,
the following build fails when initiated with the debian/ubuntu toolchain.

debuild/dpkg-buildpackage have system defaults for CFLAGS, CXXFLAGS, CPPFLAGS, 
and LDFLAGS, allowing all packages to receive 
the same set of flags, say -g -O2, or -Wl,-Bsymbolic-functions.

those variables are then passed to the builds, in my case, through cdbs, like 
this:

/usr/bin/make  -C 
/tmp/buildd/chromium-browser-4.0.259.0~svn20091127r33225/build-tree/src 
CFLAGS="-g -O2 -g -Wall -O2" 
CXXFLAGS="-g -O2 -g -Wall -O2" CPPFLAGS="" LDFLAGS="-Wl,-Bsymbolic-functions" 
-j4 SYMBOLS=1 BUILDTYPE=Release V=1 chrome 
chrome_sandbox

what i did here is just to pass DEB_BUILDDIR for -C, and 
DEB_MAKE_BUILD_TARGET="-j4 SYMBOLS=1 BUILDTYPE=Release V=1 chrome 
chrome_sandbox"

It builds for a while, then fails with:

  g++ -g -O2 -g -Wall -O2 -MMD -MF out/Release/obj.host/v8_nosnapshot/gen/libraries.o.d.tmp -c -o 
out/Release/obj.host/v8_nosnapshot/gen/libraries.o 
out/Release/obj/gen/libraries.cc
  g++ -g -O2 -g -Wall -O2 -MMD -MF out/Release/obj.host/v8_nosnapshot/v8/src/snapshot-empty.o.d.tmp -c -o 
out/Release/obj.host/v8_nosnapshot/v8/src/snapshot-empty.o 
v8/src/snapshot-empty.cc
  g++ -g -O2 -g -Wall -O2 -MMD -MF out/Release/obj.host/v8_base/v8/src/accessors.o.d.tmp -c -o 
out/Release/obj.host/v8_base/v8/src/accessors.o v8/src/accessors.cc
out/Release/obj/gen/libraries.cc:7:16: error: v8.h: No such file or directory
out/Release/obj/gen/libraries.cc:8:21: error: natives.h: No such file or 
directory
In file included from v8/src/v8.h:56,
                 from v8/src/snapshot-empty.cc:30:
v8/src/globals.h:57:2: error: #error Your target architecture is not supported 
by v8
In file included from v8/src/v8.h:56,
                 from v8/src/accessors.cc:28:
v8/src/globals.h:57:2: error: #error Your target architecture is not supported 
by v8
In file included from v8/src/top.h:31,
                 from v8/src/accessors.cc:34:
v8/src/frames-inl.h:40:2: error: #error Unsupported target architecture.
  g++ -g -O2 -g -Wall -O2 -MMD -MF out/Release/obj.host/v8_base/v8/src/allocation.o.d.tmp -c -o 
out/Release/obj.host/v8_base/v8/src/allocation.o v8/src/allocation.cc
In file included from v8/src/v8.h:56,
                 from v8/src/allocation.cc:30:

that's expected as obviously, CFLAGS has been overwritten with the toolchain 
value, while v8 clearly needed to receive some -I 
and target_arch=x64.

if i run make manually (instead of via dpkg-buildpackage) with 
BUILDTYPE=Release V=1, meaning CFLAGS and friends are not 
overwritten, the build goes on for a while longer.

But not until the end..
cube:~/chromium-browser-4.0.259.0~svn20091127r33225/build-tree/src (pbuilder)# 
make BUILDTYPE=Release V=1
 (...)
 g++ -pthread -fno-exceptions -fno-asynchronous-unwind-tables -fvisibility=hidden -Wall -D_FILE_OFFSET_BITS=64 -fno-strict-
aliasing -I/usr/include/libpng12 -I/usr/include/libxml2 -D_REENTRANT -pthread 
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include 
-I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 
-I/usr/include/pixman-1 -I/usr/include/freetype2 -
I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -O2 -fno-ident -fdata-
sections -ffunction-sections -fno-rtti -fno-threadsafe-statics 
-fvisibility-inlines-hidden -D__STDC_FORMAT_MACROS -
DCHROMIUM_BUILD -DALLOW_IN_PROC_BROWSER_TEST -DHUNSPELL_STATIC 
-DHUNSPELL_CHROME_CLIENT -DUSE_HUNSPELL -DUSE_SYSTEM_LIBPNG -
DUSE_SYSTEM_LIBXML -DUNIT_TEST -DGTEST_HAS_RTTI=0 -DNDEBUG -DNVALGRIND 
-Ithird_party/icu/public/i18n -I. -
Iout/Release/obj/gen/chrome -Iout/Release/obj/gen/net -Iskia/config 
-Ithird_party/skia/include/core -
Ithird_party/skia/include/effects -Iskia/ext -Ithird_party/harfbuzz/src 
-Ithird_party/harfbuzz/contrib -Ithird_party/zlib -
Itesting/gtest/include -Ithird_party/npapi -Ithird_party/npapi/bindings 
-Iout/Release/obj/gen/webkit -MMD -MF 
out/Release/obj.target/interactive_ui_tests/chrome/browser/blocked_popup_contain
er_interactive_uitest.o.d.tmp -c -o 
out/Release/obj.target/interactive_ui_tests/chrome/browser/blocked_popup_contain
er_interactive_uitest.o 
chrome/browser/blocked_popup_container_interactive_uitest.cc
In file included from ./app/l10n_util.h:23,
                 from chrome/browser/blocked_popup_container_interactive_uitest.cc:7:
third_party/icu/public/i18n/unicode/coll.h:52:28: error: unicode/utypes.h: No 
such file or directory
third_party/icu/public/i18n/unicode/coll.h:56:29: error: unicode/uobject.h: No 
such file or directory
In file included from third_party/icu/public/i18n/unicode/coll.h:57,
                 from ./app/l10n_util.h:23,
                 from chrome/browser/blocked_popup_container_interactive_uitest.cc:7:
third_party/icu/public/i18n/unicode/ucol.h:15:27: error: unicode/unorm.h: No 
such file or directory
third_party/icu/public/i18n/unicode/ucol.h:16:30: error: unicode/parseerr.h: No 
such file or directory
third_party/icu/public/i18n/unicode/ucol.h:17:26: error: unicode/uloc.h: No 
such file or directory
third_party/icu/public/i18n/unicode/ucol.h:18:26: error: unicode/uset.h: No 
such file or directory
In file included from ./app/l10n_util.h:23,
                 from chrome/browser/blocked_popup_container_interactive_uitest.cc:7:
third_party/icu/public/i18n/unicode/coll.h:58:29: error: unicode/normlzr.h: No 
such file or directory
third_party/icu/public/i18n/unicode/coll.h:59:27: error: unicode/locid.h: No 
such file or directory
third_party/icu/public/i18n/unicode/coll.h:60:28: error: unicode/uniset.h: No 
such file or directory
third_party/icu/public/i18n/unicode/coll.h:61:27: error: unicode/umisc.h: No 
such file or directory
third_party/icu/public/i18n/unicode/coll.h:62:27: error: unicode/uiter.h: No 
such file or directory
third_party/icu/public/i18n/unicode/coll.h:63:33: error: unicode/stringpiece.h: 
No such file or directory
In file included from 
chrome/browser/blocked_popup_container_interactive_uitest.cc:7:
./app/l10n_util.h:25:26: error: unicode/rbbi.h: No such file or directory
./app/l10n_util.h:26:27: error: unicode/ubidi.h: No such file or directory
./app/l10n_util.h:27:27: error: unicode/uchar.h: No such file or directory
In file included from third_party/icu/public/i18n/unicode/coll.h:57,
                 from ./app/l10n_util.h:23,
                 from chrome/browser/blocked_popup_container_interactive_uitest.cc:7:
third_party/icu/public/i18n/unicode/ucol.h:255: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:283: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:325: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:344: error: 'U_DEPRECATED' does not 
name a type
third_party/icu/public/i18n/unicode/ucol.h:360: error: expected constructor, 
destructor, or type conversion before 'void'
third_party/icu/public/i18n/unicode/ucol.h:375: error: expected constructor, 
destructor, or type conversion before 'void'
third_party/icu/public/i18n/unicode/ucol.h:393: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:414: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:433: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:452: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:469: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:484: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:496: error: expected constructor, 
destructor, or type conversion before 'void'
third_party/icu/public/i18n/unicode/ucol.h:512: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:528: error: expected constructor, 
destructor, or type conversion before 'const'
third_party/icu/public/i18n/unicode/ucol.h:539: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:551: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:564: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:578: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:597: error: 'U_DRAFT' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:633: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:646: error: expected constructor, 
destructor, or type conversion before 'const'
third_party/icu/public/i18n/unicode/ucol.h:670: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:697: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:719: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:747: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:808: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:825: error: expected constructor, 
destructor, or type conversion before 'void'
third_party/icu/public/i18n/unicode/ucol.h:835: error: expected constructor, 
destructor, or type conversion before 'void'
third_party/icu/public/i18n/unicode/ucol.h:860: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:876: error: expected constructor, 
destructor, or type conversion before 'void'
third_party/icu/public/i18n/unicode/ucol.h:890: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:912: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:928: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:941: error: expected constructor, 
destructor, or type conversion before 'void'
third_party/icu/public/i18n/unicode/ucol.h:966: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:988: error: 'U_STABLE' does not name 
a type
third_party/icu/public/i18n/unicode/ucol.h:1005: error: expected constructor, 
destructor, or type conversion before 'const'
third_party/icu/public/i18n/unicode/ucol.h:1023: error: expected constructor, 
destructor, or type conversion before 'const'
third_party/icu/public/i18n/unicode/ucol.h:1036: error: 'U_STABLE' does not 
name a type
third_party/icu/public/i18n/unicode/ucol.h:1050: error: 'U_INTERNAL' does not 
name a type
third_party/icu/public/i18n/unicode/ucol.h:1061: error: 'U_INTERNAL' does not 
name a type
third_party/icu/public/i18n/unicode/ucol.h:1075: error: 'U_INTERNAL' does not 
name a type
third_party/icu/public/i18n/unicode/ucol.h:1083: error: expected constructor, 
destructor, or type conversion before 'void'
third_party/icu/public/i18n/unicode/ucol.h:1106: error: expected constructor, 
destructor, or type conversion before 'void'
third_party/icu/public/i18n/unicode/ucol.h:1123: error: 'U_STABLE' does not 
name a type
third_party/icu/public/i18n/unicode/ucol.h:1145: error: 'U_STABLE' does not 
name a type
In file included from ./app/l10n_util.h:23,
                 from chrome/browser/blocked_popup_container_interactive_uitest.cc:7:
third_party/icu/public/i18n/unicode/coll.h:67: error: expected constructor, 
destructor, or type conversion before 'class'
third_party/icu/public/i18n/unicode/coll.h:177: error: expected initializer 
before ':' token
In file included from ./ipc/ipc_logging.h:8,
                 from ./chrome/common/child_process_host.h:12,
                 from ./chrome/browser/utility_process_host.h:14,
                 from ./chrome/browser/extensions/sandboxed_extension_unpacker.h:14,
                 from ./chrome/browser/extensions/extensions_service.h:24,
                 from ./chrome/browser/extensions/extension_shelf_model.h:15,
                 from ./chrome/browser/browser.h:17,
                 from ./chrome/test/automation/browser_proxy.h:16,
                 from chrome/browser/blocked_popup_container_interactive_uitest.cc:14:
./ipc/ipc_message.h:219: error: expected declaration before end of line
make: *** 
[out/Release/obj.target/interactive_ui_tests/chrome/browser/blocked_popup_contai
ner_interactive_uitest.o] Error 1

cube:~/chromium-browser-4.0.259.0~svn20091127r33225/build-tree/src (pbuilder)# 
find . -name utypes.h
./third_party/icu/public/common/unicode/utypes.h
./third_party/WebKit/WebCore/icu/unicode/utypes.h
./third_party/WebKit/JavaScriptCore/icu/unicode/utypes.h

Original issue reported on code.google.com by f...@sofaraway.org on 1 Dec 2009 at 9:54

GoogleCodeExporter commented 9 years ago
Not sure what's exactly going wrong, but I'll CC some other people in case they 
know.

Original comment by evan@chromium.org on 1 Dec 2009 at 10:09

GoogleCodeExporter commented 9 years ago

Original comment by evan@chromium.org on 1 Dec 2009 at 10:09

GoogleCodeExporter commented 9 years ago
to easily reproduce, start from a clobber build on an x64 box, run the gyp 
script as 
usual, then try "make V=1 CFLAGS=-g". it should be enough to break v8.

Original comment by f...@sofaraway.org on 5 Dec 2009 at 1:16

GoogleCodeExporter commented 9 years ago
Now that I moved my codecs package to gyp/make, i'm hitting this bug there too.

A simple fix could be to change WriteSources (in pylib/gyp/generator/make.py) 
to turn 
cflags into GYP_CFLAGS and then change cmd_cc to $(CC.$(TOOLSET)) $(CFLAGS) 
$(GYP_CFLAGS) $(DEPFLAGS) -c -o $@ $<

Original comment by f...@sofaraway.org on 12 Dec 2009 at 11:59

GoogleCodeExporter commented 9 years ago

Original comment by mmoss@chromium.org on 15 Dec 2009 at 10:17

GoogleCodeExporter commented 9 years ago
with r769, i can build chromium with make using the ubuntu toolchain. Thanks!
You can close this issue as fixed/verified (i can't)

Original comment by f...@sofaraway.org on 17 Dec 2009 at 4:42

GoogleCodeExporter commented 9 years ago
Nice!

Original comment by evan@chromium.org on 17 Dec 2009 at 4:47