Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 411161 - sys-kernel/openvz-sources-2.6.18.028.101.1 fails to compile on ia64: include/asm/hw_irq.h:142:1: error: conflicting types for '__irq_to_vector' ( include/linux/irq.h:179:12 )
Summary: sys-kernel/openvz-sources-2.6.18.028.101.1 fails to compile on ia64: include/...
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: IA64 Linux
: Normal normal (vote)
Assignee: Peter Volkov (RETIRED)
URL: http://bugzilla.openvz.org/show_bug.c...
Whiteboard:
Keywords: UPSTREAM
Depends on:
Blocks:
 
Reported: 2012-04-07 16:25 UTC by Dennis Schridde
Modified: 2013-01-11 13:31 UTC (History)
4 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 Dennis Schridde 2012-04-07 16:25:45 UTC
# make
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  CC      arch/ia64/kernel/asm-offsets.s
In file included from include/linux/irq.h:185:0,
                 from include/asm/hardirq.h:11,
                 from include/linux/hardirq.h:7,
                 from include/linux/interrupt.h:11,
                 from include/asm-ia64/mca.h:16,
                 from arch/ia64/kernel/asm-offsets.c:15:
include/asm/hw_irq.h:142:1: error: conflicting types for '__irq_to_vector'
include/linux/irq.h:179:12: note: previous declaration of '__irq_to_vector' was here
make[1]: *** [arch/ia64/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2

The declaration conflicts with the definition:
--- include/linux/irq.h
extern int __irq_to_vector(int irq);
#define irq_to_vector(irq)  __irq_to_vector(irq)
#include <asm/hw_irq.h>
--- include/asm/hw_irq.h
static inline ia64_vector irq_to_vector (int irq)

Reproducible: Always
Comment 1 Peter Volkov (RETIRED) gentoo-dev 2012-05-03 12:25:20 UTC
.config? Also if it's different from upstream provided then this is unsupported configuration (take a look at einfo at the end).
Comment 2 Dennis Schridde 2012-06-11 10:51:02 UTC
I downloaded [1] from [2], ran make mrproper, installed the config file as .config, ran make oldconfig and the issue still appeared upon make prepare:

scripts/kconfig/conf -s arch/ia64/Kconfig
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  CHK     include/linux/utsrelease.h
  UPD     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-ia64
  CC      arch/ia64/kernel/asm-offsets.s
In file included from include/linux/irq.h:185:0,
                 from include/asm/hardirq.h:11,
                 from include/linux/hardirq.h:7,
                 from include/linux/interrupt.h:11,
                 from include/asm-ia64/mca.h:16,
                 from arch/ia64/kernel/asm-offsets.c:15:
include/asm/hw_irq.h:142:1: error: conflicting types for '__irq_to_vector'
include/linux/irq.h:179:12: note: previous declaration of '__irq_to_vector' was here
make[1]: *** [arch/ia64/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2

The reason for that is the declaration of __irq_to_vector conflicting with the definition, as laid out in comment #0. A function cannot be both extern and static at the same time.

[1] http://download.openvz.org/kernel/branches/rhel5-2.6.18/028stab099.3/configs/kernel-2.6.18-ia64.config.ovz
[2] http://wiki.openvz.org/Download/kernel/rhel5/028stab099.3
Comment 3 Dennis Schridde 2012-06-11 11:07:48 UTC
The issue appears not too simple to fix to me:

# grep -R __irq_to_vector .                                                                                                                                                                                                       
./arch/x86_64/kernel/io_apic.c:int __irq_to_vector(int irq)
./arch/x86_64/kernel/io_apic.c:EXPORT_SYMBOL(__irq_to_vector);
./include/linux/irq.h:extern int __irq_to_vector(int irq);
./include/linux/irq.h:#define irq_to_vector(irq)        __irq_to_vector(irq)

Apparently x86_64 needs this to be an extern function.

However, ia64 wants it to be inline - it is defined in ./include/asm-ia64/hw_irq.h as:
static inline ia64_vector
irq_to_vector (int irq)
{
    return (ia64_vector) irq;
}

Of course both cannot be done with the same function signature.

My idea would be to make irq_to_vector static inline and wrap __irq_to_vector into it on x86_64:

--- ./include/linux/irq.h.orig  2012-06-11 12:59:22.000000000 +0200
+++ ./include/linux/irq.h       2012-06-11 13:00:56.000000000 +0200
@@ -176,8 +176,12 @@
 #define no_irq_type            no_irq_chip
 typedef struct irq_desc                irq_desc_t;
 
+#ifdef CONFIG_X86_64
 extern int __irq_to_vector(int irq);
-#define irq_to_vector(irq)     __irq_to_vector(irq)
+static inline int irq_to_vector(int irq) {
+       return __irq_to_vector(irq);
+}
+#endif
 
 /*
  * Pick up the arch-dependent methods:
---

I have not tested this on x86_64, but it makes ia64 pass the make prepare step.

The next pitfall is just waiting one step ahead, though:

arch/ia64/mm/init.c: In function 'ia64_init_addr_space':
arch/ia64/mm/init.c:171:25: error: 'vm_area_cachep' undeclared (first use in this function)
arch/ia64/mm/init.c:171:25: note: each undeclared identifier is reported only once for each function it appears in

II suggest to drop ~ia64 from KEYWORDS for the moment, until this is all sorted out.
Comment 4 Andreis Vinogradovs ( slepnoga ) 2013-01-03 21:00:01 UTC
please test latest 2.18 series kernel
Comment 5 Sergey Popov gentoo-dev 2013-01-10 13:34:45 UTC
2.6.18.028.101.1 still fails with same error. Maybe we should drop ia64 keywords for these versions for now?
Comment 6 Dennis Schridde 2013-01-10 13:46:18 UTC
(In reply to comment #5)
> 2.6.18.028.101.1 still fails with same error. Maybe we should drop ia64
> keywords for these versions for now?
Fine with me, since I will switch to LXC.
Comment 7 Andreis Vinogradovs ( slepnoga ) 2013-01-11 12:10:39 UTC
due http://bugzilla.openvz.org/show_bug.cgi?id=2484#c2 please drop keyword ia64 
and closed as wontfix
Comment 8 Sergey Popov gentoo-dev 2013-01-11 13:31:35 UTC
+  11 Jan 2013; Sergey Popov <pinkbyte@gentoo.org>
+  openvz-sources-2.6.18.028.099.3.ebuild,
+  openvz-sources-2.6.18.028.101.1.ebuild:
+  Drop ~ia64 keyword due to build failures. Upstream does not support it
+  anymore, bug #411161