Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 156301 - mysql_config wrongly retains too much info from CFLAGS
Summary: mysql_config wrongly retains too much info from CFLAGS
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
: 157429 165511 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-11-26 06:18 UTC by SpanKY
Modified: 2007-02-05 22:03 UTC (History)
3 users (show)

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


Attachments
105_all_mysql_config_cleanup.patch (105_all_mysql_config_cleanup.patch,1.49 KB, patch)
2007-01-04 14:42 UTC, Francesco R. (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description SpanKY gentoo-dev 2006-11-26 06:18:08 UTC
$ mysql_config --cflags
-I/usr/include/mysql -march=k8 -pipe -DHAVE_ERRNO_AS_DEFINE=1 -fno-exceptions -fno-strict-aliasing

the "-march=k8 -pipe" is obviously wrong
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-12-07 07:19:10 UTC
*** Bug 157429 has been marked as a duplicate of this bug. ***
Comment 2 Francesco R. (RETIRED) gentoo-dev 2006-12-10 10:30:06 UTC
I've applied changes suggested in bug #157429, (pratically reverted changeset 1.34).

actually /usr/bin/mysql_config is a bash script, it simply do cycle and sed the
the content of $cflags

for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \
              DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \
              DEXTRA_DEBUG DHAVE_purify O 'O[0-9]' 'xO[0-9]' 'W[-A-Za-z]*' \
              Xa xstrconst "xc99=none" \
              unroll2 ip mp restrict
do
  cflags=`echo "$cflags"|sed -e "s/ -$remove  */ /g"`
done

easy to add "-pipe" and "-march" here but prior to do so,
can you suggest a bigger list to strip from the flags ?

thanks
Comment 3 SpanKY gentoo-dev 2006-12-10 19:45:41 UTC
the only thing the mysql config script *should* have are CPPFLAGS ... that means things that begin with -I or -D ... i'd punt everything else

not sure if you even want to keep -D
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2006-12-10 20:02:55 UTC
-D needs to be kept as some of the mysql headers exclude/include specific things.
-L may also be important given the stuff that goes into /usr/lib/mysql/
Comment 5 Zak Kipling 2006-12-11 03:28:44 UTC
Don't the -L options belong in LDFLAGS / "mysql_config --libs" instead?
Comment 6 Francesco R. (RETIRED) gentoo-dev 2006-12-11 04:23:51 UTC
Robin wanna manage this thing? As you know my "c" and linkage skills are absent,
then i can port it to all versions we have in portage and do the testing,
Thanks ... in advance
Comment 7 SpanKY gentoo-dev 2006-12-11 19:50:26 UTC
as Zak pointed out, -L belongs only in the --libs output, not the --cflags
Comment 8 Francesco R. (RETIRED) gentoo-dev 2007-01-04 14:42:02 UTC
Created attachment 105428 [details, diff]
105_all_mysql_config_cleanup.patch

extrapolating from various comments here is the replacement code for the previous sed loop, will be added to the tree very soon.

</code>
# Remove some options that a client doesn't have to care about
tmpcflags=""
for f in $cflags
do
  case "${f}" in
    -DDBUG_OFF) f="" ;;
    -DSAFEMALLOC) f="" ;;
    -USAFEMALLOC) f="" ;;
    -DSAFE_MUTEX) f="" ;;
    -DPEDANTIC_SAFEMALLOC) f="" ;;
    -DUNIV_MUST_NOT_INLINE) f="" ;;
    -DFORCE_INIT_OF_VARS) f="" ;;
    -DEXTRA_DEBUG) f="" ;;
    -DHAVE_purify) f="" ;;
    -[ID]*) tmpcflags="${tmpcflags} ${f}" ;;
    -[Ll]*)
      libs="${libs} ${f}"
      libs_r="${libs_r} ${f}"
      embedded_libs="${embedded_libs} ${f}"
    ;;
  esac
done
cflags="${tmpcflags# }"
</code>

Thanks everyone for the patience
Comment 9 Francesco R. (RETIRED) gentoo-dev 2007-01-04 16:28:52 UTC
in cvs
Comment 10 Jakub Moc (RETIRED) gentoo-dev 2007-02-05 22:03:17 UTC
*** Bug 165511 has been marked as a duplicate of this bug. ***