sysroot not present in include paths?

81 views
Skip to first unread message

Henrik Kjellander

unread,
Jun 13, 2016, 7:56:54 PM6/13/16
to gn-...@chromium.org
Hi,

I've been working for a long time to get rid of the technical debt in src/third_party/libjingle and I'm at the stage where I should finally be able to get rid of the duplicated source lists and use the ones in WebRTC code instead: https://codereview.chromium.org/2022833002/

However, I'm lacking the sysroot /usr/include entry among my include paths, so I get errors like this when building the 'all' target for Linux:
[6171/17362] CXX newlib_pnacl/obj/third_party/webrtc/libjingle/xmpp/rtc_xmpp/presenceouttask.o
FAILED: newlib_pnacl/obj/third_party/webrtc/libjingle/xmpp/rtc_xmpp/presenceouttask.o 
/b/build/slave/cache/cipd/goma/gomacc ../../native_client/toolchain/linux_x86/pnacl_newlib/bin/pnacl-clang++ -MMD -MF newlib_pnacl/obj/third_party/webrtc/libjingle/xmpp/rtc_xmpp/presenceouttask.o.d -DNACL_TC_REV=dfb29536c5d4e8e8c26074b7bf9f982798bb97de -DFEATURE_ENABLE_SSL -D_DEBUG -DV8_DEPRECATION_WARNINGS -DENABLE_NOTIFICATIONS -DENABLE_PLUGINS=1 -DENABLE_PDF=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DUSE_OPENSSL_CERTS=1 -DNO_TCMALLOC -DENABLE_WEBRTC=1 -DENABLE_EXTENSIONS=1 -DENABLE_TASK_MANAGER=1 -DENABLE_THEMES=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_SUPERVISED_USERS=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 -DFIELDTRIAL_TESTING_ENABLED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -DDYNAMIC_ANNOTATIONS_PREFIX=NACL_ -DWEBRTC_RESTRICT_LOGGING -DEXPAT_RELATIVE_PATH -DENABLE_EXTERNAL_AUTH -DHAVE_OPENSSL_SSL_H -DHAVE_SCTP -DHAVE_SRTP -DHAVE_WEBRTC_VIDEO -DHAVE_WEBRTC_VOICE -DLOGGING_INSIDE_WEBRTC -DSRTP_RELATIVE_PATH -DSSL_USE_OPENSSL -DUSE_WEBRTC_DEV_BRANCH -DFEATURE_ENABLE_SSL -DFEATURE_ENABLE_VOICEMAIL -DEXPAT_RELATIVE_PATH -DGTEST_RELATIVE_PATH -DNO_MAIN_THREAD_WRAPPING -DNO_SOUND_SYSTEM -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DFEATURE_ENABLE_SSL -DFEATURE_ENABLE_VOICEMAIL -DXML_STATIC -DSSL_USE_OPENSSL -DHAVE_OPENSSL_SSL_H -DFEATURE_ENABLE_SSL -DLOGGING=1 -DNO_MAIN_THREAD_WRAPPING -I../.. -Inewlib_pnacl/gen -I../../third_party/webrtc_overrides -I../../third_party -I../../third_party/expat/files/lib -I../../third_party/jsoncpp/overrides/include -I../../third_party/jsoncpp/source/include -fno-strict-aliasing -fcolor-diagnostics -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-deprecated-register -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -O0 -g1 -fvisibility=hidden -fno-threadsafe-statics -fvisibility-inlines-hidden -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=gnu++11 -fno-rtti -fno-exceptions -c ../../third_party/webrtc/libjingle/xmpp/presenceouttask.cc -o newlib_pnacl/obj/third_party/webrtc/libjingle/xmpp/rtc_xmpp/presenceouttask.o
In file included from ../../third_party/webrtc/libjingle/xmpp/presenceouttask.cc:15:
In file included from ../../third_party/webrtc/libjingle/xmpp/xmppclient.h:18:
In file included from ../../third_party/webrtc/libjingle/xmpp/xmppclientsettings.h:14:
In file included from ../../third_party/webrtc/p2p/base/port.h:20:
In file included from ../../third_party/webrtc/p2p/base/candidate.h:25:
In file included from ../../third_party/webrtc/base/network.h:21:
../../third_party/webrtc/base/ipaddress.h:15:10: fatal error: 'netinet/in.h' file not found
#include <netinet/in.h>
         ^
1 error generated.
I haven't been able to figure out what I might be missing. 
While digging around, I've found that the sysroot cflag should be added here, being loaded by //build/config/compiler:runtime_library, but it doesn't seem to be.

I even added print(cflags) to build/config/posix/BUILD.gn for debugging and it prints this when I run gn gen:
["--sysroot=../../build/linux/debian_wheezy_amd64-sysroot"]
["--sysroot=../../build/linux/debian_wheezy_amd64-sysroot"]

Please help! Could it be something with NaCL? I'm not familiar with how the NaCl build really works.

Sylvain Defresne

unread,
Jun 13, 2016, 8:03:30 PM6/13/16
to Henrik Kjellander, gn-...@chromium.org
It looks like the build is for another toolchain (output is in newlib_pnacl/obj). I don't think this toolchain uses the sysroot from the line you pointed (you can try to print $current_toolchain next to the code to check).

I would recommend looking at what are the settings for that newlib_pnacl toolchain are or looking at why this target is built for the newlib_pnacl (maybe it is not needed).

Sorry I'm on my phone without access to the source, so cannot give better answer for the moment. 
-- Sylvain

Brett Wilson

unread,
Jun 13, 2016, 8:08:33 PM6/13/16
to Sylvain Defresne, Henrik Kjellander, gn-...@chromium.org
On Mon, Jun 13, 2016 at 1:03 PM, Sylvain Defresne <sdef...@chromium.org> wrote:
It looks like the build is for another toolchain (output is in newlib_pnacl/obj). I don't think this toolchain uses the sysroot from the line you pointed (you can try to print $current_toolchain next to the code to check).

I would recommend looking at what are the settings for that newlib_pnacl toolchain are or looking at why this target is built for the newlib_pnacl (maybe it is not needed).

Unless you mean to be compiling it in NaCl, my guess is that that's the problem. Does this happen in all builds or just with a change you made?

Brett

Henrik Kjellander

unread,
Jun 13, 2016, 8:14:13 PM6/13/16
to Brett Wilson, Sylvain Defresne, gn-...@chromium.org
Ah. I think you're on to something. The previously listed sources in GYP had 'nacl_untrusted_build%': 0 set as variables (see https://codereview.chromium.org/2022833002/diff/80001/third_party/libjingle/libjingle_common.gypi). Our WebRTC standalone targets doesn't, so I guess I have to configure that in our own GYP/GN files and roll that into Chromium first. And how do I set some similar to nacl_untrusted_build for GN?

Another thing is that I'm not sure how to setup a bot that properly builds our standalone code for these NaCl configurations. Does anyone know what's needed for that?

Brett Wilson

unread,
Jun 13, 2016, 8:16:26 PM6/13/16
to Henrik Kjellander, Sylvain Defresne, gn-...@chromium.org
Can you explain at a higher level what you're trying to do? There's no nacl_untrusted_build, the equivalent is expressed with toolchains and dependencies in GN.

Brett

Dirk Pranke

unread,
Jun 15, 2016, 12:25:01 AM6/15/16
to Brett Wilson, Henrik Kjellander, Sylvain Defresne, gn-...@chromium.org, Brad Nelson
+bradnelson ...

nacl_untrusted_build seems to be some sort of flag in the GYP build that propagated from target to target and controlled which nacl defines would get set, I think. I suspect you don't need to set anything at all in GN to get things to work.

The error certainly suggests that you're not setting up the NaCl toolchains properly, but it's not obvious to me that you should be getting NaCl at all in a standalone WebRTC build, so something has probably gotten confused?

If you can point me at how to set up your checkout I can probably look further ...

-- Dirk

Roland McGrath

unread,
Jun 15, 2016, 12:42:01 AM6/15/16
to Dirk Pranke, Brett Wilson, Henrik Kjellander, Sylvain Defresne, gn-...@chromium.org, Brad Nelson
GYP files use conditions testing nacl_untrusted_build to decide things
like source files to omit for the NaCl build.
In GN, the equivalent is to test is_nacl, e.g.
if (!is_nacl) {
sources += [ "notfornacl.cc" ]
}

Henrik Kjellander

unread,
Jun 17, 2016, 9:43:38 AM6/17/16
to Roland McGrath, Dirk Pranke, Brett Wilson, Sylvain Defresne, gn-...@chromium.org, Brad Nelson
I did a manual audit of all the involved build targets and it turns out there are two that builds more files than before in the Chromium builds, so I made a WebRTC CL to exclude them from Chromium builds. That will probably solve this problem (so it's most likely not a NaCl-specific thing, rather that we with my CL tries to compile objects that weren't compiled before when WebRTC is build as part of a Chromium build).

Henrik Kjellander

unread,
Jun 17, 2016, 11:08:09 AM6/17/16
to Roland McGrath, Dirk Pranke, Brett Wilson, Sylvain Defresne, gn-...@chromium.org, Brad Nelson
Nope, that was not enough, but the missing sysroot seems to be set correctly by adding

if (is_nacl) {
  deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
}

to the targets that reported these kind of failures. But then I'm moving on to the next error:
[5/1144] AR newlib_pnacl/obj/third_party/libjingle/libjingle.a
FAILED: newlib_pnacl/obj/third_party/libjingle/libjingle.a 
python "../../build/toolchain/gcc_ar_wrapper.py" --output=newlib_pnacl/obj/third_party/libjingle/libjingle.a --ar="../../native_client/toolchain/linux_x86/pnacl_newlib/bin/pnacl-ar"  rcsD @"newlib_pnacl/obj/third_party/libjingle/libjingle.a.rsp"
 ##### ['rcsD', 'newlib_pnacl/obj/third_party/libjingle/libjingle.a', '@newlib_pnacl/obj/third_party/libjingle/libjingle.a.rsp'] 
Traceback (most recent call last):
  File "../../native_client/toolchain/linux_x86/pnacl_newlib/bin/pydir/loader.py", line 30, in <module>
    ret = driver_tools.DriverMain(module, argv)
  File "/ssd/chrome/src/native_client/toolchain/linux_x86/pnacl_newlib/bin/pydir/driver_tools.py", line 749, in DriverMain
    return module.main(argv)
  File "/ssd/chrome/src/native_client/toolchain/linux_x86/pnacl_newlib/bin/pydir/pnacl-ar.py", line 22, in main
    driver_tools.ParseArgs(argv, PATTERNS)
  File "/ssd/chrome/src/native_client/toolchain/linux_x86/pnacl_newlib/bin/pydir/driver_tools.py", line 337, in ParseArgs
    driver_args, argv = ParseArgsBase(argv, driver_patternlist)
  File "/ssd/chrome/src/native_client/toolchain/linux_x86/pnacl_newlib/bin/pydir/driver_tools.py", line 366, in ParseArgsBase
    unmatched.append(argv[i])
IndexError: list index out of range
Which I haven't been able to figure out yet (needs https://codereview.webrtc.org/2077883002/ to be patched into src/third_party/webrtc to reproduce).

Brett Wilson

unread,
Jun 17, 2016, 4:43:01 PM6/17/16
to Henrik Kjellander, Roland McGrath, Dirk Pranke, Sylvain Defresne, gn-...@chromium.org, Brad Nelson
Sorry, I don't quite follow this message.

Do you mean to be compiling webrtc in nacl?

Brett

Sergey Ulanov

unread,
Jun 17, 2016, 6:45:59 PM6/17/16
to Henrik Kjellander, Roland McGrath, Dirk Pranke, Brett Wilson, Sylvain Defresne, gn-...@chromium.org, Brad Nelson
This looks like a bug in PNaCl toolchain. This CL should fix it: https://codereview.chromium.org/2076883004/
I was able to repro the error you get after applying crrev.com/2022833002 and crrev.com/2077883002 . It goes away after applying that fix for driver_tools.py in native_client/toolchain/linux_x86/pnacl_newlib/bin/pydir/driver_tools.py .

Sergey Ulanov

unread,
Jun 17, 2016, 6:51:50 PM6/17/16
to Brett Wilson, Henrik Kjellander, Roland McGrath, Dirk Pranke, Sylvain Defresne, gn-...@chromium.org, Brad Nelson
Chromoting client plugin is build for PNaCl and depends on libjingle. Henrik is working on moving libjingle to webrtc. The code is already in third_party/webrtc, but we still have third_party/libjingle with builds files. If I understand correctly the goal is to remove third_party/libjingle and use the build files in webrtc.
Reply all
Reply to author
Forward
0 new messages