Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 209237

Summary: app-portage/portage-utils contains GCC-specific constructs, fails to build on other compilers
Product: Gentoo/Alt Reporter: Stuart Shelton <srcshelton>
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: IRIX   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: portage-utils-0.2 build log

Description Stuart Shelton 2008-02-07 13:34:57 UTC
>>> Compiling source in /usr/opt/portage/var/tmp/portage/app-portage/portage-utils-0.1.28/work/portage-utils-0.1.28 ...
sed -n '/^DECLARE_APPLET/s:.*(\(.*\)).*:#include "\1.c":p' applets.h > include_applets.h
cc -DVERSION=\"0.1.28\" -DAPPLET_q -DAPPLET_qatom -DAPPLET_qcache -DAPPLET_qcheck -DAPPLET_qdepends -DAPPLET_qfile -DAPPLET_qgrep -DAPPLET_qlist -DAPPLET_qlop -DAPPLET_qmerge -DAPPLET_qpkg -DAPPLET_qsearch -DAPPLET_qsize -DAPPLET_qtbz2 -DAPPLET_quse -DAPPLET_qxpak -c99 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip35:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 1174,1183,1185,1552,3968,3970 -MM main.c > .depend
cc-1018 cc: ERROR File = main.h, Line = 51
  An unmatched left parentheses "(" appears in an expression.

  #define qfprintf(stream, fmt, args...) do { if (!quiet) fprintf(stream, _( fmt ), ## args); } while (0)
                                    ^

cc-1018 cc: ERROR File = main.h, Line = 52
  An unmatched left parentheses "(" appears in an expression.

  #define qprintf(fmt, args...) qfprintf(stdout, _( fmt ), ## args)
                           ^

cc-1018 cc: ERROR File = main.h, Line = 64
  An unmatched left parentheses "(" appears in an expression.

  # define DBG(fmt, args...)
                        ^

cc-1018 cc: ERROR File = libq/libq.h, Line = 5
  An unmatched left parentheses "(" appears in an expression.

  #define warn(fmt, args...) \
                        ^

cc-1018 cc: ERROR File = libq/libq.h, Line = 8
  An unmatched left parentheses "(" appears in an expression.

  #define warnf(fmt, args...) warn("%s%s()%s: " fmt, YELLOW, __func__, NORM , ## args)
                         ^

cc-1018 cc: ERROR File = libq/libq.h, Line = 9
  An unmatched left parentheses "(" appears in an expression.

  #define warnl(fmt, args...) warn("%s%i()%s: " fmt, YELLOW, __LINE__, NORM , ## args)
                         ^

cc-1018 cc: ERROR File = libq/libq.h, Line = 10
  An unmatched left parentheses "(" appears in an expression.

  #define warnp(fmt, args...) warn(fmt ": %s" , ## args , strerror(errno))
                         ^

cc-1018 cc: ERROR File = libq/libq.h, Line = 11
  An unmatched left parentheses "(" appears in an expression.

  #define warnfp(fmt, args...) warnf(fmt ": %s" , ## args , strerror(errno))
                          ^

cc-1018 cc: ERROR File = libq/libq.h, Line = 12
  An unmatched left parentheses "(" appears in an expression.

  #define _err(wfunc, fmt, args...) \
                               ^

cc-1018 cc: ERROR File = libq/libq.h, Line = 17
  An unmatched left parentheses "(" appears in an expression.

  #define err(fmt, args...) _err(warn, fmt , ## args)
                       ^

cc-1018 cc: ERROR File = libq/libq.h, Line = 18
  An unmatched left parentheses "(" appears in an expression.

  #define errf(fmt, args...) _err(warnf, fmt , ## args)
                        ^

cc-1018 cc: ERROR File = libq/libq.h, Line = 19
  An unmatched left parentheses "(" appears in an expression.

  #define errp(fmt, args...) _err(warnp, fmt , ## args)
                        ^

cc-1018 cc: ERROR File = libq/xasprintf.c, Line = 26
  An unmatched left parentheses "(" appears in an expression.

  #define xasprintf(strp, fmt, args...) \
                                   ^

13 errors detected in the compilation of "main.c".
Warning: Unrecognized option ( ) in "-dM"
Warning: Unrecognized option ( ) in "-dM"
Warning: Unrecognized option ( ) in "-dM"
Warning: Unrecognized option ( ) in "-dM"
: q : qatom : qcache : qcheck : qdepends : qfile : qgrep : qlist : qlop : qmerge : qpkg : qsearch : qsize : qtbz2 : quse : qxpak :
cc -c99 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip35:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 1174,1183,1185,1552,3968,3970 -Wl,-v,-s,-x,-n32,-mips4,-rdata_shared,-allow_jump_at_eop,-rpath,/opt/portage/usr/lib:/opt/portage/lib -L/opt/portage/usr/lib -L/opt/portage/lib main.c -o q
cc ERROR parsing -Wformat=2:  unknown flag
cc ERROR parsing -Wno-format-nonliteral:  unknown flag
make: *** [q] Error 2
 * 
 * ERROR: app-portage/portage-utils-0.1.28 failed.
 * Call stack:
 *               ebuild.sh, line   46:  Called src_compile
 *             environment, line 2085:  Called die
 * The specific snippet of code:
 *       emake || diefunc "$FUNCNAME" "$LINENO" "$?"
 *  The die message:
 *   (no error message)

The ERRORs above are trivially fixable - MIPSpro supports '#define function(fmt, ...)' but not '#define function(fmt, args...)'.

I'm not sure what '"-dM"' refers to, but it may be realted.

'-Wformat=2' and '-Wno-format-nonliteral' are (presumably) GCC-specific.
Comment 1 Fabian Groffen gentoo-dev 2008-02-12 10:19:35 UTC
This package is a known hell, Solaris and Darwin have problems with it too.  Basically the lack of configure (everything is #ifdef-ed on os/vendor/compiler) makes this it quite an annoyance.
Comment 2 Fabian Groffen gentoo-dev 2008-09-08 10:18:32 UTC
can you try 0.1.29 with some hacking in the build to use gnulib like aix and solaris?
Comment 3 Stuart Shelton 2008-09-25 11:56:46 UTC
Sorry for the delay in replying - I've been away on holiday.

I've altered the ebuild for CHOST == *-irix*, and now the build process also outputs:

 * Appending a library link instruction (-lgnu); libraries to link to should not be passed through LDFLAGS
cc ERROR:  no source or object file given
cc ERROR:  no source or object file given

(gnulib is definitely installed)

In any case, it's not that GNU functions are missing, it's that GNU-specific constructs which the compiler isn't able to parse are used throughout :(

(Mostly due to defining a multi-argument varadic macro and then calling it with a single parameter, e.g.:

cc-1054 cc: ERROR File = libq/xmalloc.c, Line = 35
  There are not enough arguments in a macro invocation.

                err("Out of memory");
                                   ^

... or similar, repeated 101 times <sigh>)
Comment 4 Stuart Shelton 2009-07-08 11:24:43 UTC
Created attachment 197164 [details]
portage-utils-0.2 build log


portage-utils-0.2 is no better :(
Comment 5 Fabian Groffen gentoo-dev 2009-10-25 09:20:24 UTC
This can't be fixed without a full rewrite and autotooling.  We should give up on portage-utils for non-GCC platforms.