Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 829793 - dev-util/rt-tests depends on C compiler in src_install
Summary: dev-util/rt-tests depends on C compiler in src_install
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Kurt Kanzenbach
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2021-12-22 07:43 UTC by Eddy Hsu
Modified: 2022-11-15 20:50 UTC (History)
3 users (show)

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


Attachments
patch to avoid C compiler dependency in install (rt-tests-2.2-avoid_cc_in_install.patch,974 bytes, patch)
2021-12-22 07:43 UTC, Eddy Hsu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eddy Hsu 2021-12-22 07:43:23 UTC
Created attachment 759996 [details, diff]
patch to avoid C compiler dependency in install

In `Makefile` of `rt-tests`, it retrieves `ostype` and `machinetype` by `$(CC) -dumpmachine`.

In this case, we need to specify C compiler even in `src_install`.
i.e. `emake CC=${tc-getCC} prefix=/usr DESTDIR="${ED}" install`

I would suggest to use `uname` to avoid the dependency.

Following is the patch(also attached):
```
diff --git a/Makefile b/Makefile
index 569adc1..508d7a7 100644
--- a/Makefile
+++ b/Makefile
@@ -38,15 +38,12 @@ else
 	CFLAGS	+= -O0 -g
 endif

-# We make some gueses on how to compile rt-tests based on the machine type
-# and the ostype. These can often be overridden.
-dumpmachine := $(shell $(CC) -dumpmachine)
-
+# We make some guesses on how to compile rt-tests based on the machine type
+# and the ostype.
 # The ostype is typically something like linux or android
-ostype := $(lastword $(subst -, ,$(dumpmachine)))
-
-machinetype := $(shell echo $(dumpmachine)| \
-    sed -e 's/-.*//' -e 's/i.86/i386/' -e 's/mips.*/mips/' -e 's/ppc.*/powerpc/')
+ostype := $(shell uname -o | sed -nr 's/(.*)\/.*/\1/p')
+machinetype := $(shell uname -m | \
+    sed -e 's/i.86/i386/' -e 's/mips.*/mips/' -e 's/ppc.*/powerpc/')

 # The default is to assume you have libnuma installed, which is fine to do
 # even on non-numa machines. If you don't want to install the numa libs, for

```
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-22 08:09:31 UTC
Have you sent this upstream to the kernel.org people? 

https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git

Not sure if they use an ML or kernel bugzilla
Comment 2 Eddy Hsu 2021-12-22 08:24:56 UTC
Yes, I have sent out the patch by following git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/tree/MAINTAINERS
Comment 3 Kurt Kanzenbach 2022-11-15 20:50:27 UTC
Fixed by https://github.com/gentoo/gentoo/pull/23462.