Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 243528 - app-cdr/cdrtools: CC variable not respected
Summary: app-cdr/cdrtools: CC variable not respected
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Optical Media project
Depends on:
Blocks: tc-directly
  Show dependency tree
Reported: 2008-10-24 00:10 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2009-10-13 19:28 UTC (History)
3 users (show)

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

Patch to cdrtools-2.01.01_alpha57-r1.ebuild to switch to use of qualified gcc name (cdrtools-2.01.01_alpha57-r1.ebuild.patch,768 bytes, patch)
2009-09-26 22:16 UTC, Kevin Pyle
Details | Diff
cdrtools-2.01.01_alpha66.diff (cdrtools-2.01.01_alpha66.diff,832 bytes, patch)
2009-10-12 20:53 UTC, Daniel Pielmeier
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2008-10-24 00:10:35 UTC
I'm filing this bug (from a template, mind you) because the ebuild I'm reporting it against failed to build once I removed my /usr/bin/{gcc,cc,c++,c99} binaries. This means that the ebuild is relying on gcc or cc as compiler, while it should use "$(tc-getCC)" so that user choices are respected, and cross-compiling works as intended.

This usually comes down to one of these tasks:

- use emake CC="$(tc-getCC)" for building, to ovewrite make's CC variable (defaults to "cc", some upstream rewrites it);
- the above plus replacing explicit "gcc" (or similar) calls with $(CC) so that the variable is actually respected;
- tc-export CC in src_compile before eventual econf.

For C++, you'd have to replace CC with CXX everywhere above, of course.

If your package is a special case on this, please let me know.

Comment 1 Daniel Pielmeier gentoo-dev 2008-10-30 08:48:33 UTC
Currently the ebuild already uses CC="$(tc-getCC) in src_compile. When looking in the INSTALL file of cdrtools [1] it mentions CCOM instead of CC for using a different compiler.

So replacing CC="$(tc-getCC) with CCOM="$(tc-getCC) should do the trick.
Diego is there an easy way to check if the variable is repected when doing so, if not can you make a second run on your system with this change and check again?


Using a different C-compiler:

If the configured default compiler is not present on the current machine, the makefilesystem will try an automatic fallback to GCC. For this reason in most cases you will not need to manually select a compiler.

The default C-compiler can be modified in the files in the DEFAULT directory. If you want to have a different compiler for one compilation, call:

make CCOM=gcc or make CCOM=cc

This works even when your make program doesn't propagate make macros.
Comment 2 Peter Alfredsen (RETIRED) gentoo-dev 2008-11-02 14:04:16 UTC
Hrm... To me it looks like I'll have to make symlinks like so:
ln -s x86_64-linux-gcc.rul x86_64-linux-$(tc-getCC).rul
(for each arch) to get this to work. Too much trouble, too much variety to consider for my taste. Patches will be accepted.
Comment 3 Greg Trigg 2009-05-12 16:38:34 UTC
I also had this problem on ppc64.  I use distcc for my updates to a cross-compiler on my 686.  I had to turn distcc off for the build to succeed on the ppc64 box.
Comment 4 Kevin Pyle 2009-09-26 22:16:10 UTC
Created attachment 205345 [details, diff]
Patch to cdrtools-2.01.01_alpha57-r1.ebuild to switch to use of qualified gcc name

This patch modifies cdrtools-2.01.01_alpha57-r1.ebuild to add two sed calls in src_prepare, which replace use of gcc/g++ with the results of tc-getCC and tc-getCXX, respectively.  With this patch applied, I can build and install cdrtools-2.01.01_alpha57-r1 without any apparent call to gcc.

The patch also applies automatically to cdrtools-2.01.01_alpha65, albeit with a bit of fuzz.  With the patch, that version also builds and installs without any apparent call to gcc.
Comment 5 Daniel Pielmeier gentoo-dev 2009-10-12 20:53:58 UTC
Created attachment 206903 [details, diff]

If i temporarily remove /usr/bin/{gcc,cc,c++,c99} i get the following error even with the patch attached.

make -j3 -j1 'CC=i686-pc-linux-gnu-gcc -D__attribute_const__=const' 'COPTX=-march=native -O2 -pipe -fomit-frame-pointer -finput-charset=ISO-8859-1 -fexec-charset=UTF-8' LIB_ACL_TEST=-lacl CPPOPTX= LDOPTX=-Wl,-O1 GMAKE_NOWARN=true 
RULES/ RULES/ldummy.lnk: Datei oder Verzeichnis nicht gefunden
RULES/ incs/Dnull: Datei oder Verzeichnis nicht gefunden
RULES/ incs/Dcc.x86-linux: Datei oder Verzeichnis nicht gefunden
RULES/ RULES/i686-linux-cc.rul: Datei oder Verzeichnis nicht gefunden
RULES/rules.cnf:66: incs/x86-linux-cc/Inull: Datei oder Verzeichnis nicht gefunden
RULES/rules.cnf:67: incs/x86-linux-cc/rules.cnf: Datei oder Verzeichnis nicht gefunden
	==> MAKING DIRECTORY "incs/x86-linux-cc/Inull"
	==> CONFIGURING RULES "incs/x86-linux-cc/rules.cnf"
creating cache ./config.cache
checking host system type... Invalid configuration `unknownCPU-unknownMFR-unknownOS': machine `unknownCPU-unknownMFR' not recognized

checking if sh is bash... yes
checking if /bin/sh is bash... yes
checking whether sh -ce is broken... no
checking whether /bin/sh -ce is broken... no
checking whether /bin/bosh is a working shell... no
checking whether /opt/schily/bin/bosh is a working shell... no
checking for object suffix... configure: error: installation or configuration problem; compiler does not work
make: *** [incs/x86-linux-cc/rules.cnf] Fehler 1

The sed needs to be extended to make cdrtools configure normal. See attached patch.

Please can someone review this patch as i am not sure if this is the right thing to do. If it is okay i will commit this with the cdrtools-2.01.01_alpha66 version bump.
Comment 6 Samuli Suominen (RETIRED) gentoo-dev 2009-10-12 21:00:27 UTC
The fix will be done properly in the upstream's configure script and posted in the ML instead of introducing this hack into the ebuild.
Comment 7 Daniel Pielmeier gentoo-dev 2009-10-13 19:28:55 UTC
Fixed in cdrtools-2.01.01_alpha66.