Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 270860 - www-servers/apache apxs2 should _not_ save the CFLAGS and LDFLAGS used during build
Summary: www-servers/apache apxs2 should _not_ save the CFLAGS and LDFLAGS used during...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: cflags portage-multilib ldflags
  Show dependency tree
 
Reported: 2009-05-22 19:01 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2021-05-03 22:08 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2009-05-22 19:01:09 UTC
flame@yamato apache2 % /usr/sbin/apxs2 -q LDFLAGS
-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--sort-common -Wl,--no-as-needed
flame@yamato apache2 % /usr/sbin/apxs2 -q CFLAGS 
-march=barcelona -O2 -ftracer -pipe -ftree-vectorize -g -ggdb -Wstrict-aliasing=2 -Wno-format-zero-length -Wformat=2 -Wno-error -Wno-pointer-sign

This really shouldn't happen.
Comment 1 Peter Volkov (RETIRED) gentoo-dev 2011-09-15 09:08:58 UTC
Diego, as I understand the idea is to build modules with the same CFLAGS/LDFLAGS as the server itself. So this is "by design" and I can't think of good reasons to do this differently. 

When built, modules are part of apache and ... there is no reason to build them with different settings. It's like there is no measures/need to allow users build parts of the _same_ package with different compiler options.
Comment 2 Arfrever Frehtes Taifersar Arahesis 2011-09-15 18:33:22 UTC
apxs2 is also used by some third-party Apache modules.
Comment 3 Peter Volkov (RETIRED) gentoo-dev 2011-09-16 03:48:09 UTC
My idea is that this third party modules when built are part of apache and separation of sources does not make it somehow different from modules that come with apache.
Comment 4 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2011-09-16 04:10:17 UTC
The external modules are separate enough from apache that they have their own ebuilds. And, upstream supports this separation somewhat. In this case, Gentoo is not forcibly splitting up a package which is designed to be compiled altogether (which is the case in gstreamer plugins).

Since the apache2 core code and external module code are created by different authors, it is conceivable that CFLAGS which work fine with apache2 might not work with modules or vice versa. The apache project and other module writers must have varying coding standards and paradigms.

Keeping flags around proliferates stale flag settings. Also, it is frustrating when packages such as apache2 modules just don't obey CFLAGS, CPPFLAGS, LDFLAGS, and other friends (for this reason, portage-multilib has to treat apache specially). It is also more confusing to debug module build failures when this paradigm of apache2 installing its own buildsystem for use by modules is used.

Unfortunately, it appears that it is difficult for modules to compile against apache2 on their own. Yet apache2 does support it with apxs -q's INCLUDEDIR and LIBEXECDIR options and the apxs(8) manpage explicitly states that modules may have their own buildsystems and use CPPFLAGS=-I`apxs -q INCLUDEDIR`. But this sort of thing requires working with upstreams...
Comment 5 Peter Volkov (RETIRED) gentoo-dev 2011-09-16 05:27:16 UTC
(In reply to comment #4)
> Since the apache2 core code and external module code are created by different
> authors, it is conceivable that CFLAGS which work fine with apache2 might not
> work with modules or vice versa.

If module is very different - just fix module build system to use CFLAGS from environment. My statement here is that apxs2 works as it should - provides CFLAGS apache was build with.

> Keeping flags around proliferates stale flag settings. Also, it is frustrating
> when packages such as apache2 modules just don't obey CFLAGS, CPPFLAGS,
> LDFLAGS, and other friends (for this reason, portage-multilib has to treat
> apache specially).

That's understandable. But I think fix lays elsewhere. May be provide apxs2-$ABI tools for each ABI apache was built with and then we'll have to fix module's build system anyway. I'm not sure there is perfect solution here but in any case I'd like solution be upstreamable.