--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/13679089-7e25-45b5-8886-e3cdea19cc3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/209b083d-8c53-4bf2-a503-cfccee7ebf3b%40googlegroups.com.
compiler_flag: “-isystem” compiler_flag: “external/LinuxGcc47Repo/x86_64-linux/lib/gcc/x86_64-linux/4.7.0/include” |
new_local_repository(name = 'LinuxGcc47Repo',build_file = 'compilers/x86_64_linux_gcc_4.7.0.BUILD',path = '/sw/packages/gcc/c4.7.0-p1',)
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/F23AD79C-F111-4CFF-9C36-312B95454FC3%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
On Aug 25, 2017, at 5:59 AM, Marcel Hlopko <hlo...@google.com> wrote:
Hi Indra,can we move this discussion back to the bazel-discuss so other people can benefit from the solutions we come up with? Obviously helping every crosstool author in private doesn't scale well.Re the project you've sent:WORKSPACE: You don't need new_local_repository for packages that are under the current WORKSPACE.tools/BUILD: cc_toolchain rule is there to collect all the extra input files your toolchain depends on. In your case, you depend on x86_64_gcc_headers, so that filegroup needs to be referenced from cc_toolchain. Bazel will then make sure to copy all the headers to the appropriate directories when compiling in sandbox.tools/CROSSTOOL: seems ok.With the headers you provide, don't you need e.g. -lssl somewhere? If you can trust your linker to find the libraries, then just adding linker_flag: '-lssl' is enough. If you cannot, then this is where you would use new_local_repository - to get to the libssl.a/libssl.so :new_local_repository(name = "ssl",path = "/usr/lib/x86_64-linux-gnu",build_file_content = """cc_library(name = "ssl",srcs = ["libssl.so"],visibility = ["//visibility:public"],)"" ")And then depend on @ssl//:ssl from your cc_libraries/cc_binaries.Does it make sense at all what I wrote? :)
On Wed, Aug 23, 2017 at 10:42 PM Indra Gunawan <ind...@gmail.com> wrote:
HI Marcel,Do you have a chance to take a look at my working in progress repo?Thank you-IndraOn Aug 23, 2017, at 7:28 AM, Indra Gunawan <ind...@gmail.com> wrote:Hi Marcel,I can move the location of the toolchain CROSSTOOL to be inside $(TOP)/build tree directory such that the $(TOP)/build/bin-x86_64/4.7.0/include can be referred in the CROSSTOOL.Would you please review if I have done so correctly. Attached is the zip file of my work in progress git repo.<bazel-repo.zip.bin>I have question about cc_toolchain() in the build/tools/BUILD file.Shall I define filegroup named “linux_all_files” like this in build/tools/BUILD file.filegroup(name = “linux_all_files”,srcs = [@buildToolChainRepo//:x86_64_gcc_headers”,],)and set cc_toolchain(name = ‘cc-compiler_gcc”,all_files = “:linux_all_files”,…)Are those above necessary?I just want to make sure that gcc compiler is called like below eventually:gcc.c4.7.0-p1.x86_64 -c -include /nobackup/ingunawa/xrv9kws/build/icc-preincl.h \-g -pipe -fsigned-char -fno-builtin -nostdinc -fdebug-prefix-map=/nobackup/ingunawa/xrv9kws=/XR_SRC -D__CCI_HW_ENABLE__ -D__SPIRIT_ARCHITECTURE__ -D__QNXNTO__ -D__IOSNG__ -DNTO_BUILD=64 -fPIC -D__X86__ -D__x86_64__ -D__LINUX__ -D__XR_LINUX__ -D_GNU_SOURCE -D__LITTLEENDIAN__ -DOBJECT_X86 -DPLATFORM_INDIRECT_32BIT -DPLATFORM_INDIRECT_16BIT -DPLATFORM_INDIRECT_8BIT -Dfalse=0 -Dtrue=1 -D__BASE_OS_LINUX__ -D__PLATFORM_XRV9K__ -D__NEED_DLLMAIN__ -fPIC -Wl,--build-id=sha1 -D__X86_LINUX__ -DTARGET_CISCO -DQSTAR_REVISIT -D__IOX_DLL__ -DBUILDENV_iox -DRM_DLLMGR_TMP= -D__USE_SHARED_OBJECTS__ -Wall -Werror -Wpointer-arith -Wformat -Wno-error=enum-compare -Wno-error=switch -Wno-error=unused-variable -Wno-error=unused-function -Wno-error=unused-but-set-variable -O0 -D__DO4ARG__ $BASESRCOPT \-O1 -fno-strict-aliasing -fno-omit-frame-pointer -Itty/infra/error/src -Itty/infra/error/obj-x86_64-linux-spirit -Icrypto/cepki/ciscossl/include -Ibuild/bin-x86_64/4.7.0/include -I/sw/packages/protoc/v.1.14/include -Iinc/x86_64-linux-spirit/global/iosxr-os -Iinc/x86_64-linux-spirit/global/iosxr-os/os -Iinc/x86_64-linux-spirit/global/iosxr-os/os/lnx -Iinc/x86_64-linux-spirit/global/iosxr-os/os/lnx-wrappers -Iinc/x86_64-linux-spirit/global/iosxr-infra/scripting/slang/slang_210 -Iinfra/xoslib/include -Iinc/x86_64-linux-spirit/package/iosxr-os/tty/infra/error -Iinc/x86_64-linux-spirit/global/iosxr-os/tty/infra/error -Iinc/x86_64-linux-spirit/package/iosxr-os -Iinc/x86_64-linux-spirit/global/iosxr-os -Iinc/x86_64-linux-spirit/global/iosxr-parser -Iinc/x86_64-linux-spirit/global/iosxr-fwding -Iinc/x86_64-linux-spirit/global/iosxr-infra \-include /nobackup/ingunawa/xrv9kws/infra/rtd/osc/bosc/include/osc_header.h -o /nobackup/ingunawa/xrv9kws/tty/infra/error/obj-x86_64-linux-spirit/G0_tty_error.o /nobackup/ingunawa/xrv9kws/tty/infra/error/src/tty_error.c “See above "-Ibuild/bin-x86_64/4.7.0/include” . Adding it in CROSSTOOL as : "cxx_builtin_include_directory: "%package(@buildToolChainRepo//bin-x86_64/4.7.0/include)%”” is fine?I am also asking about conditions in general. Does “compiler_flags” feature work for any if I define it in CROSSTOOL?Can you provide an example with a sample CROSSTOOL that uses it?Thank you-Indra
--
Google Germany GmbH | Erika-Mann-Str. 33 | Contact | Germany Managing Director: Managing Director: Paul Manicle, Halimah DeLaine Prado | Register court and number: Hamburg, HRB 86891
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/66d26d7b-70d8-43a3-bf7c-b2f03aa8b2d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.