Ticket #6102 (new defect)

SVN Diffs for #6102

 

Opened 1 year ago

Last modified 10 months ago

icu-config hardcodes C[XX|PP]FLAGS and LDFLAGS

Reported by: jakub@... Assigned to: srl
Priority: minor Milestone: UNSCH
Component: config_build Version: 3.8.1
Keywords: Cc:
Load: Xref:
Java Version: Operating System:
Project (C/J): ICU4C Weeks: 0.5
Review:

Description

This really doesn't belong there, please don't add such stuff in config/Makefile.inc.in as it injects these flags into any package that depends on ICU and uses icu-config during compile.

See http://bugs.gentoo.org/show_bug.cgi?id=202059 for downstream bug.

Attachments

Change History

12/20/07 01:13:03 changed by grhoten

  • priority changed from major to minor.
  • project changed from all to ICU4C.
  • weeks changed.
  • xref changed.
  • revw changed.

Can you describe the problem in more detail or supply a patch? It looks like icu-config is working as designed, and the bug report is a little too vague about what problem needs to be fixed.

Test cases and samples are always welcome.

On a related note, we don't use automake. ICU only uses GNU make. Makefile.inc is only meant for GNU makefiles. The icu-config script is meant for any non-GNU makefiles.

12/20/07 09:23:13 changed by srl

  • version changed from Current to 3.8.1.

This and the downstream bug are very short on details. * How are you obtaining the specific flag values? (steps to reproduce) * What should the values be? (expected results) * What are the values you are seeing? (observed results)

Makefile.inc sets a lot of things, probably a lot of things you don't need or want set. It is designed to give you another option for building, especially very small programs - not large complicated projects which have their own opinion about different things. If you want specific pieces of the configuration, use icu-config.

I'm not sure what the downstream bug is trying to say. Can you clarify it and put the clarification here as a reply?

( By the way the .ebuild file is wrong, this project is actually "International Components for Unicode" )

12/23/07 06:20:36 changed by anonymous

You are sticking C[XX|PP]FLAGS/LDFLAGS *used* for compile into icu-config. Subsequently, when any other application uses icu-config --{cflags,ldflags} or whatnot to find out the needed info, this injects those C[XX|PP]FLAGS/LDFLAGS to compile of that application.

That's obviously wrong - user-specified flags may have changed meanwhile, this also kills any crosscompile because passing stuff like -march=athlon-xp when you want to cross-compile this for amd64 or ppc or whatever other arch plain won't fly.

Once again - the icu-config output should only provide the stuff shown in http://bugs.gentoo.org/show_bug.cgi?id=202059#c2, not any user-specified C[XX|PP]FLAGS/LDFLAGS used at compile-time.

Thanks.

12/23/07 06:34:18 changed by jakub@...

A quick fix, as used in the Gentoo ebuild:

for x in CFLAGS CXXFLAGS CPPFLAGS LDFLAGS ; do

sed -i -e "/${x} =.*/s:@${x}@::" config/Makefile.inc.in

done

I.e., do not do things like CFLAGS = @CFLAGS@ in the above file. If you need/want flags like -W* or -D* there, that's fine, but injecting flags passed by user at compile time (such as -march=athlon-xp -O2 -pipe -fomit-frame-pointer) is definitely no good.

12/23/07 06:35:56 changed by jakub@...

Stupid trac autoformatting... :/

for x in CFLAGS CXXFLAGS CPPFLAGS LDFLAGS ; do
	sed -i -e "/^${x} =.*/s:@${x}@::" config/Makefile.inc.in
done

01/31/08 20:35:50 changed by grhoten

  • owner changed from somebody to srl.
  • weeks set to 0.5.

Add/Change #6102 (icu-config hardcodes C[XX|PP]FLAGS and LDFLAGS)




Anti spam check: