xfree86 compilation failure due to naming conflict (linux 2.4.17, Xfree86 4.1.0)

jon svendsen (jon-sven@frisurf.no)
Thu, 10 Jan 2002 05:45:55 +0100


On 2002.01.10 05:39 jon svendsen wrote:
Hello,

The SiS DRM drivers in the 2.4.17 linux kernel has caused the
possibility of failure to compile xfree86 4.1.0 (and CVS). The cause of
the conflict is the definition of CONFIG_DRM_SIS, used both in kernel
configuration and in the xfree86 DRM code.

If DRM is enabled in the kernel (CONFIG_DRM) but the SiS driver is
disabled or configured as a module, <linux/autoconf.h>, included from
<linux/config.h>, will contain an #undef CONFIG_DRM_SIS.

<linux/config.h> is included from
xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h in the
xfree86 source tree. The file
xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c does a
#define CONFIG_DRM_SIS prior to including this file in order to have
necessary parts of it included.

It flows something like this:

xf86drmSiS.c:
#define CONFIG_DRM_SIS
#include "drm.h"

drm.h:
#include <linux/config.h> // #undef CONFIG_DRM_SIS

#ifdef CONFIG_DRM_SIS
// stuff necessary for compilation of xf86drmSiS.c
#endif

And compilation of xf86drmSiS.c fails.

I'd supply a patch, but I'm not familiar enough with the relationship
between the kernel and xfree86 drivers to know what the proper solution
would be, nor am I certain if the modification should happen in linux
or in xfree86. Hopefully I have supplied enough information facilitiate
a fairly simple solution.

Jon Svendsen
--- Sorcerer GNU Linux (http://sorcerer.wox.org)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/