[PATCH] gas: z80: allow -c option for compatibility

Jan Beulich jbeulich@suse.com
Thu Jun 26 14:23:44 GMT 2025


On 26.06.2025 15:43, Zeal8bit wrote:
> Hello,
> I encountered an issue when making a CMake-based project that uses `z80-elf-as` as the assembler.
> The option `-c` is always generated to assemble a file, and it triggers the following error:
> 
>     z80-elf-as: option '-c' is ambiguous; possibilities: '-compress-debug-sections' '-colonless'
>     
> However, providing `-c` when assembling files using x86_64-target or RISC-V-target versions of GAS don't trigger any issue, thus it seems like there is a compatibility issue for the Z80-target version.

For x86 and RISC-V there simply is no other conflicting option, so -c
is shorthand for -compress-debug-sections.

But then other architectures also aren't overly relevant here. What's
more relevant is what Z80 assembler(s) support -c, and what the option
is meaning there.

> @@ -96,6 +97,7 @@ const struct option md_longopts[] =
>    { "Wnins",     required_argument, NULL, OPTION_MACH_INST},
>    { "without-inst", required_argument, NULL, OPTION_MACH_NO_INST},
>    { "local-prefix", required_argument, NULL, OPTION_COMPAT_LL_PREFIX},
> +  { "c" ,        no_argument, NULL, OPTION_COMPAT_C_IGNORE},

That's odd - why don't you add to md_shortopts[]? You don't want to also
permit --c, do you?

Jan


More information about the Binutils mailing list