Bug 114475 - Final mode breaks on pie usage
Summary: Final mode breaks on pie usage
Status: RESOLVED FIXED
Alias: None
Product: kscreensaver
Classification: Miscellaneous
Component: kcheckpass (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kscreensaver bugs tracking
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-16 02:19 UTC by Diego Elio Pettenò
Modified: 2008-05-19 17:32 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò 2005-10-16 02:19:10 UTC
Version:            (using KDE KDE 3.4.92)
Installed from:    Gentoo Packages
Compiler:          x86_64-pc-linux-gnu-gcc (GCC) 4.0.2 (Gentoo 4.0.2-r1) 
OS:                Linux

When using --enable-final, kcheckpass fails to build on AMD64 (and probably any other PIC-liker architecture).

The reason of this is that using --enable-final it seems to bypass the special automake rules, and just uses make builtin rules. This ignores the target_CFLAGS variables, where KDE_USE_FPIC is set, thus, the link stage (that still honor target_LDFLAGS) tries to link with -pie objects built without pic support (without -fpie).

While kcheckpass fails entirely to build, other targets might bypass other special CFLAGS/CXXFLAGS set per-target, leading to unexpected behavior.

A workaround for kcheckpass is probably to set AM_CFLAGS in the Makefile.am of the kcheckpass directory, but it's just a workaround, something else might be preferred.
Comment 1 Oswald Buddenhagen 2005-10-16 09:01:47 UTC
sounds like an am_edit bug (unless you're using unsermake).
Comment 2 danarmak 2005-10-16 18:50:14 UTC
We're not using unsermake.
Comment 3 David Faure 2005-10-17 00:10:31 UTC
434792    mueller kcheckpass_CFLAGS = $(KDE_USE_FPIE)
Comment 4 Oswald Buddenhagen 2005-10-17 08:08:33 UTC
it's not dirk's fault, david - unless we have the rule that everyone who starts using a (relatively) new automake feature has to fix am_edit himself. :)
Comment 5 David Faure 2005-10-17 10:55:07 UTC
> it's not dirk's fault, david - unless we have the rule that everyone who starts using a (relatively) new automake feature has to fix am_edit himself. :)

Well, Dirk is also one of the main am_edit hackers...
Also, he probably knows better than me how to fix this properly, since I have
no idea about pic and pie (except for apple pies, of course).
Comment 6 Oswald Buddenhagen 2005-10-17 11:38:01 UTC
ah, so there are actually *two* am_edit hackers. then it's ok, of course. :-P

it's not about particular flags, only about foo_CFLAGS (which overrides AM_CFLAGS; CFLAGS itself is used always and the Makefile.am is not supposed to mess with it) in general. at least i think so.
Comment 7 Dirk Mueller 2005-10-17 14:09:39 UTC
its a long known problem that _CPPFLAGS etc do not work with recent automake + am_edit. 

Adding support for that is nontrivial last time I looked into it. I'd suggest to make $(KDE_USE_PIE) a AM_CPPFLAG in this case and be done. 

Comment 8 Dirk Mueller 2005-10-20 10:51:30 UTC
SVN commit 472231 by mueller:

fix compilation with pie support
BUG: 114475


 M  +1 -2      Makefile.am  


--- branches/KDE/3.5/kdebase/kcheckpass/Makefile.am #472230:472231
@@ -2,14 +2,13 @@
 ## written by Christian Esken
 ##
 
-INCLUDES= $(all_includes)
+INCLUDES= $(KDE_USE_FPIE) $(all_includes)
 
 bin_PROGRAMS = kcheckpass
 
 kcheckpass_SOURCES = kcheckpass.c \
 	checkpass_etcpasswd.c checkpass_pam.c checkpass_shadow.c \
 	checkpass_osfc2passwd.c checkpass_aix.c
-kcheckpass_CFLAGS = $(KDE_USE_FPIE)
 kcheckpass_LDADD = -lkdefakes $(PASSWDLIBS) $(LIBSOCKET)
 kcheckpass_LDFLAGS = $(KDE_USE_PIE) $(all_libraries)
 
Comment 9 Diego Elio Pettenò 2005-10-20 11:59:49 UTC
Is this really fixed? Now probably kcheckpass works, but what about other targets that uses special CFLAGS?
Comment 10 David Faure 2005-10-20 12:18:33 UTC
> Is this really fixed? Now probably kcheckpass works, but what about other targets that uses special CFLAGS?

Which targets in particular? I don't think we have the same elsewhere in KDE.
Comment 11 Diego Elio Pettenò 2005-10-20 12:34:45 UTC
Okay, that makes as "targets depending on _CFLAGS present are broken and need to be fixed for --enable-final, right? :)

From Portage perspective this means that we might need to patch some extra packages if they shows a similar behavior, or to blacklist kdeenablefinal for them.

Anyway, I'll apply the patch to kcheckpass in Gentoo so that it builds fine.
Comment 12 David Faure 2005-10-20 12:41:56 UTC
> From Portage perspective this means that we might need to patch some extra packages if they shows a similar behavior, or to blacklist kdeenablefinal for them.

... or to report such problems and we'll fix them too...
Comment 13 Diego Elio Pettenò 2005-10-20 12:53:26 UTC
External packages, you want to know about them? :)
Comment 14 David Faure 2005-10-20 13:00:59 UTC
> External packages, you want to know about them? :)


No. I thought we were talking about KDE (as in KDE releases) here.