Bug 13424
Summary: | kernel build fails when agp driver configured as built-in | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | kevan | ||||
Component: | kernel | Assignee: | Michael K. Johnson <johnsonm> | ||||
Status: | CLOSED DEFERRED | QA Contact: | |||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 6.2 | CC: | alan, b-nordquist, gaburici, kevan | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i386 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2000-08-16 16:48:56 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
kevan
2000-07-03 21:55:05 UTC
Yep, the same thing happened to me. This worked with the older 2.2.14-12, but it seems broken again in 2.2.16-3... I've fixed this. There were actually two bugs. 1) The first one was in drivers/char/agp/Makefile. The upper level Makefile (drivers/char) looked for agp/agpgart.o. Note that the explicit rule for agpgart.o was redundant, so I removed it. ======================================================================= --- Makefile.orig Tue Jun 20 00:32:10 2000 +++ Makefile Thu Jul 6 13:44:30 2000 @@ -3,7 +3,8 @@ # space ioctl interface to use agp memory. It also adds a kernel interface # that other drivers could use to manipulate agp memory. -O_TARGET := agp.o +O_TARGET := agpgart.o +M_OBJS := $(O_TARGET) ifeq ($(CONFIG_AGP),y) O_OBJS += agpgart_fe.o @@ -12,11 +13,9 @@ ifeq ($(CONFIG_AGP), m) MI_OBJS += agpgart_fe.o MIX_OBJS += agpgart_be.o - M_OBJS += agpgart.o endif endif -include $(TOPDIR)/Rules.make +all: all_targets -agpgart.o: agpgart_be.o agpgart_fe.o - $(LD) $(LD_RFLAG) -r -o $@ agpgart_be.o agpgart_fe.o +include $(TOPDIR)/Rules.make ======================================================================= 2) The second bug was in agpgart_be.c, where agp_initialize() was mistakenly declared static, although it is called from init/main.c. ======================================================================= --- agpgart_be.c.orig Thu Jul 6 13:46:11 2000 +++ agpgart_be.c Thu Jul 6 13:47:16 2000 @@ -2131,7 +2131,7 @@ extern int agp_frontend_initialize(void); extern void agp_frontend_cleanup(void); -static int __init agp_initialize(void) +int __init agp_initialize(void) { int ret_val; ======================================================================= Thanks for the patches! Got me over this hurdle. I'm going to attach them as one file, relative to /usr/src/linux, for easier patching. Created attachment 1027 [details]
gaburici.ro patches in one easy-to-use file
*** Bug 15229 has been marked as a duplicate of this bug. *** Thanks for the patch, I have included it in our kernel source tree. That patch breaks dynamic building, even if I leave the explicit agpgart.o rule in place. I'm removing it from our kernel. Building dynamic is far more important to us than building static. johnsonm is right, modular build was broken as I have submitted the patch. The problem actually lies in Rules.make, because there is no rule how to build the M_OBJS from MI_OBJS and MIX_OBJS so defining those two is not enough, an explicit rule is needed in the agpgart Makefile, but I had it removed :-( The problem is further complicated because O_TARGET and M_OBJS cannot be the same if an explicit rule is given on how to build M_OBJS, because O_TARGET does have an explicit rule in Rules.make. To compensate for this change, the upper level Makefile must also be tweaked. Refix to allow both static and modular builds: 1) Fix agpgart_be.c as described previously. 2) Fix drivers/char/Makefile: ======================================================================= --- Makefile.orig Wed Aug 9 15:22:38 2000 +++ Makefile Wed Aug 9 16:08:06 2000 @@ -372,7 +372,7 @@ endif ifeq ($(CONFIG_AGP),y) -L_OBJS += agp/agpgart.o +L_OBJS += agp/agp.o ALL_SUB_DIRS += agp SUB_DIRS += agp else ======================================================================= 3) Leave the Makefile in drivers/char/agp/ in it's original form. Actually one can make more obvious what's going on by patching it like this: ======================================================================= --- Makefile.orig Tue Jun 20 00:32:10 2000 +++ Makefile Wed Aug 9 16:11:04 2000 @@ -3,20 +3,23 @@ # space ioctl interface to use agp memory. It also adds a kernel interface # that other drivers could use to manipulate agp memory. -O_TARGET := agp.o - -ifeq ($(CONFIG_AGP),y) +ifeq ($(CONFIG_AGP), y) + O_TARGET := agp.o O_OBJS += agpgart_fe.o OX_OBJS += agpgart_be.o else ifeq ($(CONFIG_AGP), m) + M_OBJS := agpgart.o MI_OBJS += agpgart_fe.o MIX_OBJS += agpgart_be.o - M_OBJS += agpgart.o endif endif -include $(TOPDIR)/Rules.make +# Special rule to build the composite module +ifeq ($(CONFIG_AGP), m) agpgart.o: agpgart_be.o agpgart_fe.o $(LD) $(LD_RFLAG) -r -o $@ agpgart_be.o agpgart_fe.o +endif + +include $(TOPDIR)/Rules.make ======================================================================= I have tested these patches both for modular and monolithic builds and things were fine. (Sorry for submitting fragmented diffs instead of one for the whole tree, but I don't have enough disk space for two kernel trees...) Alan, want to suck this into your official 2.2.17pres? AGP is not considered in a fit state to merge with 2.2 standard - yet An alternative set of fixes are going into 2.2.18pre and AGP/DRM will be in 2.2.18 barring disasters |