First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 145206
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Python Gentoo Team <python@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: SpanKY <vapier@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
python-2.5.2-distutils-cxxflags.patch distutils uses CXXFLAGS instead of CFLAGS for C++ files patch Markus Peloquin 2008-04-03 07:50 0000 3.54 KB Details | Diff
python-2.5.2-distutils-cxxflags.patch fixed some strange things in my last patch (irrelevant code) patch Markus Peloquin 2008-04-03 08:02 0000 3.14 KB Details | Diff
python-2.5.2-distutils-cxxflags.patch Better language detection patch Markus Peloquin 2008-04-07 06:18 0000 4.11 KB Details | Diff
diff-between-revisions.patch The difference between last two revisions I made. patch Markus Peloquin 2008-04-07 06:20 0000 1.88 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 145206 depends on: Show dependency tree
Bug 145206 blocks: 212178
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2006-08-26 15:11 0000
the wxpython package compiles a lot of C++ code using $(CFLAGS) instead of
$(CXXFLAGS)

# portageq envvar -v CFLAGS CXXFLAGS
CFLAGS='-O2 -march=k8 -pipe -Wimplicit-function-declaration'
CXXFLAGS='-O2 -march=k8 -pipe'

# emerge wxpython
...
x86_64-pc-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -march=k8
-pipe -Wimplicit-function-
declaration -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DHAVE_CONFIG_H
-DWXP_USE_THREAD=1 -UNDEBUG -DGTK_N
O_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA
-Iinclude -Isrc -I/usr/
lib64/wx/include/gtk2-ansi-release-2.6 -I/usr/include/wx-2.6
-I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.
0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0
-I/usr/include/glib-2.0 
-I/usr/lib64/glib-2.0/include -I/usr/include/python2.4 -c src/gtk/grid_wrap.cpp
-o build-gtk2/temp.linu
x-x86_64-2.4/src/gtk/grid_wrap.o
cc1plus: warning: command line option "-Wimplicit-function-declaration" is
valid for C/ObjC but not for
 C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is
valid for C/ObjC but not for
 C++
...

------- Comment #1 From Ryan Hill 2007-12-28 20:40:38 0000 -------
i took a look at this and i can't find where CFLAGS gets picked up by the build
system.   the only place that it seems to even look is in config.py:

cflags = os.popen(WX_CONFIG + ' --cxxflags', 'r').read()[:-1]

which still wouldn't use CFLAGS.  unless it gets this info from swig somehow.

------- Comment #2 From SpanKY 2007-12-29 10:06:45 0000 -------
i'm guessing this is distutils failing

/usr/lib/python2.5/distutils/sysconfig.py

this checks CFLAGS, CPPFLAGS, and LDFLAGS -- no CXXFLAGS

------- Comment #3 From Markus Peloquin 2008-04-03 07:50:42 0000 -------
Created an attachment (id=148178) [details]
distutils uses CXXFLAGS instead of CFLAGS for C++ files

I added "-include killcpp.h" to CFLAGS, where killcpp.h contained illegal c++
code, but valid c.  emerge finished, so I'm pretty sure my solution worked :) 
I'm pretty sure it's correct, but I hope somebody with more python skills can
look it over.

I hope nobody minds that I patched against python-2.5.2, but that's what I have
installed, and I need some sleep.

------- Comment #4 From Markus Peloquin 2008-04-03 08:01:32 0000 -------
(From update of attachment 148178 [details])
strangeness crept in

------- Comment #5 From Markus Peloquin 2008-04-03 08:02:58 0000 -------
Created an attachment (id=148180) [details]
fixed some strange things in my last patch (irrelevant code)

------- Comment #6 From Tiziano Müller 2008-04-03 13:00:12 0000 -------
@Mark: nice job. The patch I started working on was meant to do the same but
you were a bit faster.
I guess it can be included as it is.

------- Comment #7 From SpanKY 2008-04-07 02:03:28 0000 -------
where did you get the .c/.m list of types ?  there are other types which should
go through the C compiler, but i think it may be saner to flip the logic ...
hard code the list for C++, and have everything else go through C ...

otherwise, thanks, it looks good :)

------- Comment #8 From Markus Peloquin 2008-04-07 06:18:36 0000 -------
Created an attachment (id=148946) [details]
Better language detection

Maybe this is more what you're looking for.  I found a function
detect_language() that uses a map of extension -> language.  Below is a patch
from my previous revision to this one.

------- Comment #9 From Markus Peloquin 2008-04-07 06:20:21 0000 -------
Created an attachment (id=148947) [details]
The difference between last two revisions I made.

------- Comment #10 From SpanKY 2008-04-07 21:33:46 0000 -------
ah, very nice ... that looks good to me

------- Comment #11 From Ali Polatel (RETIRED) 2008-04-18 14:31:49 0000 -------
+*python-2.5.2 (18 Apr 2008)
+*python-2.4.4-r10 (18 Apr 2008)
+*python-2.3.6-r5 (18 Apr 2008)
+
+  18 Apr 2008; Ali Polatel <hawking@gentoo.org> +python-2.3.6-r5.ebuild,
+  +python-2.4.4-r10.ebuild, +python-2.5.2.ebuild:
+  Version bumps. Updated patchsets to fix buffer overflow in zlib extension
+  (CVE-2008-1721) bug 217221 and unsafe PyString_FromStringAndSize(). Added
+  patch by Mark Peloquin for distutils to respect CXXFLAGS, bug 145206. Add
+  wininst USE flag to conditionally install MS Windows executables, bug
+  198021. Use EAPI=1, rename nothreads and nocxx USE flags to threads and
+  cxx.
+

Thanks Mark, I've included your patch to our patchset.

------- Comment #12 From Darren Dale 2008-04-19 13:48:13 0000 -------
Yikes, this patch breaks distutils if CXXFLAGS is not defined. I discovered it
when I tried to compile matplotlib outside of portage. Distutils fails with the
following traceback:

Traceback (most recent call last):
  File "setup.py", line 277, in <module>
    **additional_params
  File "/usr/lib64/python2.5/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib64/python2.5/distutils/dist.py", line 974, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python2.5/distutils/dist.py", line 994, in run_command
    cmd_obj.run()
  File "/usr/lib64/python2.5/distutils/command/build.py", line 112, in run
    self.run_command(cmd_name)
  File "/usr/lib64/python2.5/distutils/cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "/usr/lib64/python2.5/distutils/dist.py", line 994, in run_command
    cmd_obj.run()
  File "/usr/lib64/python2.5/distutils/command/build_ext.py", line 265, in run
    customize_compiler(self.compiler)
  File "/usr/lib64/python2.5/distutils/sysconfig.py", line 177, in
customize_compiler
    cxx_cmd = cxx + ' ' + cxxflags
TypeError: cannot concatenate 'str' and 'NoneType' objects

If I define CXXFLAGS, I can compile again.

------- Comment #13 From Ali Polatel (RETIRED) 2008-04-19 14:46:35 0000 -------
2.5.2-r2 and 2.4.4-r11 fixes that.

First Last Prev Next    No search results available      Search page      Enter new bug