mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-27 22:02:33 +01:00
Add an optional additional set of positional parameters that can be passed to the `link` subcommand for Clang-style (or GCC-style) `LDFLAGS`. These can _also_ contain object files, etc., and in fact it is useful to allow them to contain object files in order to integrate the `carbon link` subcommand into a build system that mixes both link flags and object files. This at least happens with Bazel, and I suspect is common. Eventually, it would be nice to have sufficient semantics to handle all the varieties of links we want without resorting to this escape hatch, but that's likely a long way away and so it seems especially useful to allow falling back to Clang's flags as needed for now. This does somewhat directly surface the Clang implementation detail in the command line syntax, but I don't see a lot of good alternatives. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
16 lines
792 B
Plaintext
16 lines
792 B
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// ARGS: --include-diagnostic-kind link --output=foo
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/driver/testdata/link/fail_object_files_missing.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/link/fail_object_files_missing.carbon
|
|
// CHECK:STDERR: error: no object files provided to link command and no extra Clang options that could provide them [LinkObjectFilesMissing]
|
|
// CHECK:STDERR:
|
|
|
|
// --- foo.carbon
|