Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unknown argument: '-gno-inline-line-tables' #226

Closed
hayd opened this issue Jan 19, 2020 · 18 comments · Fixed by #251
Closed

unknown argument: '-gno-inline-line-tables' #226

hayd opened this issue Jan 19, 2020 · 18 comments · Fixed by #251

Comments

@hayd
Copy link
Contributor

hayd commented Jan 19, 2020

I get this error when building deno from source (this used to work in 0.29.0):

clang: error: unknown argument: '-gno-inline-line-tables'
bash-4.2# clang --version
clang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /tmp/clang-llvm/bin

Am I doing something wrong here?

xlink #200 (#49 and denoland/deno#3711)

@chrmoritz
Copy link
Contributor

chrmoritz commented Jan 19, 2020

Looks like -gno-inline-line-tables was added in llvm/llvm-project@ab76cfd (a recommit of llvm/llvm-project@6d03890), which isn't part of a stable llvm/clang release yet. To use it on Linux, you have to either use a version of llvm build from the master branch or use Google's clang binaries.

@ry
Copy link
Member

ry commented Jan 19, 2020

We could also provide a way to opt out of this flag. Note we have hacked chromium's build repository to add this flag: denoland/chromium_build@65d79729a

@hayd
Copy link
Contributor Author

hayd commented Jan 19, 2020

I had hoped you could grab the latest clang:

curl -s https://raw.githubusercontent.com/chromium/chromium/master/tools/clang/scripts/update.py | python - --output-dir=/tmp/clang

But this seems to provide a clang which requires GLIBC (which wasn't the case in 0.29.0).

https://github.com/hayd/deno-docker/runs/397889910

@hayd
Copy link
Contributor Author

hayd commented Jan 21, 2020

@ry is there a way to un-hack the chromium_build from deno_src (I don't see config/compiler/BUILD.gn in deno_src.tar.gz I was hoping to try editing before building).

@ry
Copy link
Member

ry commented Jan 21, 2020

@hayd
Copy link
Contributor Author

hayd commented Jan 21, 2020

Sorry for being unclear, I mean how do I edit that file to test this locally? (I wanted to just remove the '-gno-inline-line-tables' and confirm it would build.)

@ry
Copy link
Member

ry commented Jan 21, 2020

@hayd check out denoland/chromium_build@65d79729a

Essentially you'll want to revert that commit (or better, make it conditional), and update the build submodule in rusty_v8.

@hayd
Copy link
Contributor Author

hayd commented Jan 22, 2020

Reverting to hayd@37c7578 (off of v0.1.0):

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/root/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308.build_script_build.cthswd1e-cgu.0.rcgu.o" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308.build_script_build.cthswd1e-cgu.1.rcgu.o" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308.build_script_build.cthswd1e-cgu.10.rcgu.o" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308.build_script_build.cthswd1e-cgu.11.rcgu.o" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308.build_script_build.cthswd1e-cgu.12.rcgu.o" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308.build_script_build.cthswd1e-cgu.13.rcgu.o" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308.build_script_build.cthswd1e-cgu.14.rcgu.o" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308.build_script_build.cthswd1e-cgu.2.rcgu.o" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308.build_script_build.cthswd1e-cgu.3.rcgu.o" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308.build_script_build.cthswd1e-cgu.4.rcgu.o" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308.build_script_build.cthswd1e-cgu.5.rcgu.o" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308.build_script_build.cthswd1e-cgu.6.rcgu.o" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308.build_script_build.cthswd1e-cgu.7.rcgu.o" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308.build_script_build.cthswd1e-cgu.8.rcgu.o" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308.build_script_build.cthswd1e-cgu.9.rcgu.o" "-o" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308" "/deno/target/release/build/deno-68e731bd6d880308/build_script_build-68e731bd6d880308.3mi1i5enhiniah13.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/deno/target/release/deps" "-L" "/deno/target/release/gn_out/obj/" "-L" "/root/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/deno/target/release/deps/libdeno_typescript-cb315d03bb532af6.rlib" "/deno/target/release/deps/libdeno_core-0633541d77d82972.rlib" "/deno/target/release/deps/liburl-269c610edcd2d054.rlib" "/deno/target/release/deps/libpercent_encoding-7a28a2739828bc81.rlib" "/deno/target/release/deps/libidna-464218550c8c5c7a.rlib" "/deno/target/release/deps/libunicode_normalization-8d0023bef6e8ebeb.rlib" "/deno/target/release/deps/libsmallvec-71e9bac2f145148b.rlib" "/deno/target/release/deps/libunicode_bidi-7fc66763bf2e3ff2.rlib" "/deno/target/release/deps/libmatches-32057ddf050d1071.rlib" "/deno/target/release/deps/libserde_json-4a09f513a0f5733f.rlib" "/deno/target/release/deps/libryu-658c99df18434bd7.rlib" "/deno/target/release/deps/libitoa-bf453d7c00eccd10.rlib" "/deno/target/release/deps/libindexmap-4fe690d745c3b799.rlib" "/deno/target/release/deps/libserde-f4c0075054381ccc.rlib" "/deno/target/release/deps/librusty_v8-dc8118c98d70110d.rlib" "/deno/target/release/deps/liblazy_static-f73092d385abbdd3.rlib" "/deno/target/release/deps/libbitflags-34d6e20d451463ab.rlib" "/deno/target/release/deps/libdowncast_rs-b6c7a4b095f3701b.rlib" "/deno/target/release/deps/libfutures-ae17c9f2e99c9947.rlib" "/deno/target/release/deps/libfutures_executor-08843d008626ad68.rlib" "/deno/target/release/deps/libnum_cpus-d6a658e3a82d2bc6.rlib" "/deno/target/release/deps/libfutures_util-e0ab97afae3439ec.rlib" "/deno/target/release/deps/libmemchr-8f94c8c076c0471a.rlib" "/deno/target/release/deps/libproc_macro_nested-3a73ea783fe0a78b.rlib" "/deno/target/release/deps/libtokio_io-a70aa829aeef1b41.rlib" "/deno/target/release/deps/libbytes-76179ae36bea9e5c.rlib" "/deno/target/release/deps/libiovec-d43be0f52ab4426f.rlib" "/deno/target/release/deps/liblibc-3a23dd11839429e0.rlib" "/deno/target/release/deps/libbyteorder-0f53f5fd73f8302c.rlib" "/deno/target/release/deps/libfutures-8c87d2bd6215e345.rlib" "/deno/target/release/deps/libfutures_io-c2b682dd68323da8.rlib" "/deno/target/release/deps/libslab-dc477f7e7b73d2ea.rlib" "/deno/target/release/deps/libfutures_channel-63cc5a7c43a70ea6.rlib" "/deno/target/release/deps/libfutures_sink-f177bb11d7341522.rlib" "/deno/target/release/deps/libfutures_task-c8d48239083dbf8d.rlib" "/deno/target/release/deps/libpin_utils-4404457761adc86b.rlib" "/deno/target/release/deps/libfutures_core-debc7a148b51c7a2.rlib" "/deno/target/release/deps/liblog-0b2d00c4a1042c38.rlib" "/deno/target/release/deps/libcfg_if-f3544b1da576ae5e.rlib" "-Wl,--start-group" "/root/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-74488c47a41eb313.rlib" "/root/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-efbc2c947951b8cc.rlib" "/root/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-b177382d9a04ffbe.rlib" "/root/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-ba7d2244d33447d5.rlib" "/root/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-39569dc87e4ea301.rlib" "/root/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-cd9e255bd82ddb5c.rlib" "/root/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-f83165e777dccb8d.rlib" "/root/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-10b085de263b1750.rlib" "/root/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-9a4a22edf44da957.rlib" "/root/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-68fabc677efa98de.rlib" "/root/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-026dc0061b48e8b6.rlib" "/root/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-7bf75bb619341145.rlib" "/root/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-ef54709e300503ed.rlib" "-Wl,--end-group" "/root/.rustup/toolchains/1.40.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-4ed27d8420cb4abc.rlib" "-Wl,-Bdynamic" "-lutil" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
  = note: /deno/target/release/deps/libdeno_core-0633541d77d82972.rlib(deno_core-0633541d77d82972.deno_core.2k1o9q8c-cgu.1.rcgu.o): In function `deno_core::bindings::send::h38092064a52b8522':
          deno_core.2k1o9q8c-cgu.1:(.text._ZN9deno_core8bindings4send17h38092064a52b8522E+0x1ca): undefined reference to `v8__ArrayBuffer__New__byte_length'
          deno_core.2k1o9q8c-cgu.1:(.text._ZN9deno_core8bindings4send17h38092064a52b8522E+0x254): undefined reference to `v8__ArrayBuffer__New__byte_length'
          /deno/target/release/deps/libdeno_core-0633541d77d82972.rlib(deno_core-0633541d77d82972.deno_core.2k1o9q8c-cgu.1.rcgu.o): In function `deno_core::bindings::shared_getter::h7e6a864b1bd2b8f8':
          deno_core.2k1o9q8c-cgu.1:(.text._ZN9deno_core8bindings13shared_getter17h7e6a864b1bd2b8f8E+0x56): undefined reference to `v8__SharedArrayBuffer__New__DEPRECATED'
          collect2: error: ld returned 1 exit status

Am I doing something wrong in the revert?

@piscisaureus
Copy link
Member

piscisaureus commented Jan 22, 2020

@hayd These are all symbols that have been removed from rusty_v8. You probably need to pull the 'deno' repo to get denoland/deno@8c3cd63.

@hayd
Copy link
Contributor Author

hayd commented Jan 22, 2020

What I did: checked out 0.1.0 rusty_v8; cd build; reverted denoland/chromium_build@65d79729a; commit/push; then pointed Cargo.toml of deno 0.30.0 to my rusty_v8 branch 🤷‍♂ I will try this again!

@hayd
Copy link
Contributor Author

hayd commented Jan 23, 2020

This did work for me, can -gno-inline-line-tables be behind a flag?

@ry
Copy link
Member

ry commented Jan 23, 2020

@hayd Yes, do you know how to do that? You need to add a new "arg" to the declare_args block at the top of //build/config/compiler/BUILD.gn.

We probably need to add a cargo feature to toggle it... We don't have an example of this yet.

@chrmoritz
Copy link
Contributor

chrmoritz commented Jan 23, 2020

There is already the possibility to specify export GN_ARGS="no_inline_line_tables=false". Using this together with chrmoritz/chromium_build@9b42295 should work.

@hayd
Copy link
Contributor Author

hayd commented Jan 23, 2020

Thanks for the fix!

I am still very confused at the glibc dependency (and how it plays in denoland/deno#3711 )

@chrmoritz
Copy link
Contributor

@hayd FYI: The newly released llvm 10 now supports -gno-inline-line-tables out of the box. Also with it the unknown warning options are down to only complaining about -Wno-non-c-typedef-for-linkage, which is a big improvement over llvm 9 (or 8).

@hayd
Copy link
Contributor Author

hayd commented Mar 31, 2020

Thanks @chrmoritz I bumped to clang 10 and removed it in amazonlinux1 deno-docker (for aws lambda) and get the smaller binary 🥳. What was confusing was I able to undo it, using clang 9, and it still built! (it didn't use to) https://github.com/hayd/deno-docker/actions/runs/66067472

@chrmoritz
Copy link
Contributor

chrmoritz commented Mar 31, 2020

@hayd: Are you setting V8_FROM_SOURCE=1, otherwise you're getting the prebuilt rusty_v8 binary instead of building rusty_v8 from source. This would explain why -gno-inline-line-tables isn't an issue anymore for you and it doesn't need to be a bad thing for your use case (if it doesn't break something).

@hayd
Copy link
Contributor Author

hayd commented Mar 31, 2020

Wow, you're right... I'm shocked it's compatible!

Since lambda tests still pass so looks like it isn't breaking anything.

I wonder what this means wrt musl issues...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants