Modify

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#12153 closed defect (worksforme)

compile error, incorrect -O option passed to windres

Reported by: chris@… Owned by: developers
Priority: response-needed Milestone: Chaos Calmer 15.05
Component: base system Version: Trunk
Keywords: windres Cc:

Description

I am compiling for first time using cygwin. worked through case sensitive and ncurses issues. now compile is erroring out for what appears to be a non-cygwin issue.

this command from the compile fails
/usr/bin/bash ../../libtool --mode=compile windres -DHAVE_CONFIG_H -I. -I../.. \

-I../../src/liblzma/api -I../../src/liblzma/common -I../../src/liblzma/check -I../../src/liblzma/lz -I../../src/liblzma/rangecoder -I../../src/liblzma/lzma -I../../src/liblzma/delta -I../../src/liblzma/simple -I../../src/common -DTUKLIB_SYMBOL_PREFIX=lzma_ -O2 -I/home/chris/openwrt/trunk/staging_dir/host/include \

-i liblzma_w32res.rc -o liblzma_w32res.lo

and the culprit is the "-O2" option which appears to be a cc optimization level that has found its way into the windres command options. the -O switch for windres expects a output FORMAT which is one of rc, res, or coff and -O2 is clearly illegal.

I am guessing this is somehow a cygwin issue but hard to see how it could be. Its also hard to see how this bug could exist for other users since the compile would be broken and all would be howling. Any help?

Attachments (1)

make.out (194.0 KB) - added by chris@… 5 years ago.
make output for compile that fails due to illegal windres -O2 option

Download all attachments as: .zip

Change History (7)

Changed 5 years ago by chris@…

make output for compile that fails due to illegal windres -O2 option

comment:1 Changed 5 years ago by chris@…

My workaround/hack is modify

trunk\build_dir\host\xz-5.0.4\src\xzdec\Makefile

change

# Windows resource compiler support. It's fine to use xz_CPPFLAGS
# also for lzmadec.
#.rc.o:
# $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
# $(xzdec_CPPFLAGS) $(CPPFLAGS) $(RCFLAGS) -i $< -o $@
# CLH 9/9/12 replaced above removed CPPFLAGS because it was passing -O2 option to
# windres which is illegal
.rc.o:

$(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \

$(xzdec_CPPFLAGS) $(RCFLAGS) -i $< -o $@

After that change, compile makes it to the next Makefile that invokes windres with CPPFLAGS. My conclusion is either cygwin has a version of windres thats different than others (but checking options supported by other versions of windres seems to refute that) or when I created my build environment something injected CPPFLAGS into the windres command lines, the likely issue. So, possible when creating build environment its picking up CPPFLAGS from somewhere?

comment:2 Changed 5 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

Should be fixed with r33351

comment:3 Changed 5 years ago by anonymous

  • Resolution fixed deleted
  • Status changed from closed to reopened

synced with latest source 33358 and still get the same error. I noticed that the makefile i hacked was not replaced, so am I updating correctly? I reran

make menuconfig

but original makefiles with bug that passes in CPPFLAGS is still there. What am I doing wrong? Or is bug not fixed?

Thanks,
Chris

comment:4 Changed 5 years ago by jow

  • Resolution set to worksforme
  • Status changed from reopened to closed

make tools/xz/{clean,compile} V=99

comment:5 Changed 5 years ago by chris@…

That did it, thanks.

comment:6 Changed 4 years ago by jow

  • Milestone changed from Backfire 10.03.2 to Chaos Calmer (trunk)

Milestone Backfire 10.03.2 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.