Skip to content

emcc: recursive response files are ignored #25387

@ktock

Description

@ktock

Emcc fails to compile a program if a respose file contains a reference to another respose file.

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 4.0.15 (09f52557f0d48b65b8c724853ed8f4e8bf80e669)
clang version 22.0.0git (https:/github.com/llvm/llvm-project 3388d40684742e950b3c5d1d2dafe5a40695cfc1)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /emsdk/upstream/bin

Failing command line in full:

hello.c

#include <stdio.h>

int main() {
  printf("hello\n");
  return 0;
}

file1 (response file)

@file2

file2 (response file)

-o hello hello.c

file1 points to another response file file2.

Expected behaviour

Both of emcc @file1 and emcc @file2 succeeds.

Actual behaviour

  • emcc @file1 : failed with an error emcc: error: @file2: No such file or directory ("@file2" was expected to be an input file, based on the commandline arguments provided)
  • emcc @file2 : succeeded

Full link command and output with -v appended:

N/A

Additional information

GCC supports recursive response files, according to the man page.

The file may itself contain additional @file options; any such options will be processed recursively.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions