RE: Query on GCC command options size limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jonathan:

Are there some examples for this @file using in GCC command option?

Locally we usually create makefile and call GCC to compile similar as below script:

# Collect GCC options (include dirs, defines etc.)
CC := gcc
CC_OPTS := -c -ggdb3 -std=gnu99 -Winline -w -fgnu89-inline -g -fomit-frame-pointer
CC_OPTS += -include Platformtypes_Stubs.h
CC_OPTS += $(foreach d, $(INCDIRS), -I$d)
CC_OPTS += $(foreach p, $(INCDIRS_PTU), -I$d)
CC_OPTS += $(foreach d, $(DEFINES), -D$d)
# Options for static library build
AR := ar
AR_OPTS := rcs

$(OBJDIR)/%.o: $(OBJDIR)/%.c
      @echo Compiling: $(<F)
      @$(CC) $(CC_OPTS) $< -o $@

Now on above script, we find GCC command option in CC_OPTS content is too huge(About 12000 bytes inside) and it can not be analyzed totally in gcc command.


Regards,

----------------------------------------------
Martin

From: Jonathan Wakely <jwakely.gcc@xxxxxxxxx>
Sent: 2021年8月31日 16:03
To: Luo Xinsheng SGH ADWA4 <xinsheng.luo@xxxxxx>
Cc: gcc-help <gcc-help@xxxxxxxxxxx>
Subject: Re: Query on GCC command options size limit


On Tue, 31 Aug 2021, 07:43 Luo Xinsheng SGH ADWA4 via Gcc-help, <gcc-help@xxxxxxxxxxx<mailto:gcc-help@xxxxxxxxxxx>> wrote:
Dear sir:

Now I am using GCC to compile a series .c file with a huge directory to search for header files.

I find on GCC command options, there seems to be the size limit on provided options.
>From my test on GCC version 4.8.5, the options length which I can provide seems to be limited at 12000 characters.

Can you share the size limit of GCC command options?


I think the limit probably comes from the shell, not from GCC.

You can use the @file option to pass extra options to GCC in a file, instead of on the command line. See the last option in the page at:
https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/Overall-Options.html






Best Regards
----------------------------------------------------
Martin




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux