linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: linux-2.4.6-pre6: numerous dep_{bool,tristate} $CONFIG_ARCH_xxx bugs
@ 2001-06-30 14:57 Adam J. Richter
  2001-06-30 15:01 ` Russell King
  0 siblings, 1 reply; 33+ messages in thread
From: Adam J. Richter @ 2001-06-30 14:57 UTC (permalink / raw)
  To: alan; +Cc: kaos, linux-kernel, rmk

I am following up my own message here.

>>> = Adam Richter
>>  = Alan Cox
>   = Adam Richter

>>> 	Argh!  I just accidentally sent and older version of my
>>> patch.  Here is the current version.  Sorry about that.

>>This just breaks stuff

>>> +for var in $(cat arch/*/config.in |
>>> +	     egrep -w -v '^[ 	]*int' |
>>> +             tr '   $"' '\n\n\n' |
>>> +	     egrep '^CONFIG_[A-Z0-9_]*$' |
>>> +	     sort -u) ; do
>>> +	define_bool "$var" "n"
>>> +done
>>> +set -f
>>>  

>>You've changed the entire semantics of dep_tristate by doing this

>	Please provide a real example.

	Although I am curious about what you had in mind about
dep_tristate, I no longer need to see this example to see a problem
with my patch.  My patch breaks detection of "new" variables in
arch/*/config.in by "make oldconfig."

	So, I guess something like Keith Owens's patch would be the
way to go, with some additional definitions (CONFIG_AGP, CONFIG_PCI,
CONFIG_ISA, CONFIG_EISA, CONFIG_PCMCIA, and possibly others).  I am
not sure which other conditionals might also be incorrectly ignored by
some instances of dep_xxx.  Below, I have included a list of the 52
CONFIG_* variables that are used as arguments to dep_xxx in 2.4.6-pre6
and appear in arch/*/config.in.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

CONFIG_ACPI
CONFIG_AGP
CONFIG_AMIGA
CONFIG_ARCH_ACORN
CONFIG_ARCH_ARCA5K
CONFIG_ARCH_CLPS711X
CONFIG_ARCH_FOOTBRIDGE
CONFIG_ARCH_NETWINDER
CONFIG_ARCH_SA1100
CONFIG_ATARI
CONFIG_ATM
CONFIG_BLK_DEV_IDE
CONFIG_BLK_DEV_LOOP
CONFIG_BLK_DEV_RAM
CONFIG_BUSMOUSE
CONFIG_CPU_26
CONFIG_CPU_32
CONFIG_DEBUG_LL
CONFIG_DEVFS_FS
CONFIG_DRM
CONFIG_EISA
CONFIG_EXPERIMENTAL
CONFIG_FOOTBRIDGE
CONFIG_GVPIOEXT
CONFIG_IDE
CONFIG_IEEE1394
CONFIG_IEEE1394_OHCI1394
CONFIG_INPUT
CONFIG_ISA
CONFIG_ISDN
CONFIG_MAC
CONFIG_MCA
CONFIG_MD
CONFIG_MODULES
CONFIG_NET
CONFIG_PARPORT
CONFIG_PCI
CONFIG_PCMCIA
CONFIG_PM
CONFIG_PPP
CONFIG_PROC_FS
CONFIG_SA1100_ASSABET
CONFIG_SBUS
CONFIG_SCSI
CONFIG_SERIAL
CONFIG_SGI
CONFIG_SOUND
CONFIG_SPARC64
CONFIG_UNIX98_PTYS
CONFIG_VIDEO_DEV
CONFIG_X86
CONFIG_ZORRO

^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: linux-2.4.6-pre6: numerous dep_{bool,tristate} $CONFIG_ARCH_xxx bugs
@ 2001-06-30 13:32 Adam J. Richter
  0 siblings, 0 replies; 33+ messages in thread
From: Adam J. Richter @ 2001-06-30 13:32 UTC (permalink / raw)
  To: alan; +Cc: kaos, linux-kernel, rmk

>> 	Argh!  I just accidentally sent and older version of my
>> patch.  Here is the current version.  Sorry about that.

>This just breaks stuff

>> +for var in $(cat arch/*/config.in |
>> +	     egrep -w -v '^[ 	]*int' |
>> +             tr '   $"' '\n\n\n' |
>> +	     egrep '^CONFIG_[A-Z0-9_]*$' |
>> +	     sort -u) ; do
>> +	define_bool "$var" "n"
>> +done
>> +set -f
>>  

>You've changed the entire semantics of dep_tristate by doing this

	Please provide a real example.

	As far as I can tell, the only change would be to make
dep_tristate behave the way it was expected to, as in
drives/sound/Config.in:

      dep_tristate '    Netwinder WaveArtist' CONFIG_SOUND_WAVEARTIST $CONFIG_SOUND_OSS $CONFIG_ARCH_NETWINDER

	The current, unintended, behavior is to allow this module to be
built all all non-ARM architectures (and probably bomb out), as well
as the intended architecture of ARM-Netwinder, and not any other ARM
platforms.  The intended behavior, and the one that you would get with
either my change or Keith's is to only allow this module to be built
for ARM-Netwinder.


Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: linux-2.4.6-pre6: numerous dep_{bool,tristate} $CONFIG_ARCH_xxx bugs
@ 2001-06-30  9:38 Adam J. Richter
  0 siblings, 0 replies; 33+ messages in thread
From: Adam J. Richter @ 2001-06-30  9:38 UTC (permalink / raw)
  To: rmk; +Cc: linux-kernel

>From: Russell King <rmk@arm.linux.org.uk>
>On Sat, Jun 30, 2001 at 08:26:22AM +0100, Alan Cox wrote:
>> #2
>> 	dep_tristate $FOO $BAR
>> 
>> to say 'FOO requires BAR and must be a similar setting _IF_CONFIGURED_'

>Err, how can $BAR be undefined?  Configure sets all config variables which
>are answered with 'n' to 'n'.

One example would be processing of the following line on a non-sparc
computer (from linux-2.4.6-pre6/drivers/sbus/audio/Config.in):

dep_tristate '  Sun Microsystems userflash support' CONFIG_MTD_SUN_UFLASH $CONFIG_SPARC64

I think this could also come up for drivers that depend on
$CONFIG_ISA when configured for non-PC platforms that do not ask
about ISA support.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: linux-2.4.6-pre6: numerous dep_{bool,tristate} $CONFIG_ARCH_xxx bugs
@ 2001-06-30  4:40 Adam J. Richter
  2001-06-30  7:23 ` Alan Cox
  0 siblings, 1 reply; 33+ messages in thread
From: Adam J. Richter @ 2001-06-30  4:40 UTC (permalink / raw)
  To: alan, rmk; +Cc: kaos, linux-kernel


	Argh!  I just accidentally sent and older version of my
patch.  Here is the current version.  Sorry about that.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."
--------------------------CUT HERE----------------------------------
--- linux-2.4.6-pre6/scripts/Configure	Sat Dec 30 18:16:13 2000
+++ linux/scripts/Configure	Fri Jun 29 21:39:24 2001
@@ -48,6 +48,10 @@
 #
 # 24 January 1999, Michael Elizabeth Chastain, <mec@shout.net>
 # - Improve the exit message (Jeff Ronne).
+#
+# 29 June 2001, Adam J. Richter, <adam@yggdrasil.com>
+# - Default all non-numeric variables arch/*/config.in to "n"
+
 
 #
 # Make sure we're really running bash.
@@ -531,6 +535,18 @@
 echo " * Automatically generated C config: don't edit" >> $CONFIG_H
 echo " */" >> $CONFIG_H
 echo "#define AUTOCONF_INCLUDED" >> $CONFIG_H
+
+# Ensure all unselected architecture variables are set to "n" rather than being
+# undefined, so that dep_bool and dep_tristate properly detect their absense.
+set +f
+for var in $(cat arch/*/config.in |
+	     egrep -w -v '^[ 	]*int' |
+             tr '   $"' '\n\n\n' |
+	     egrep '^CONFIG_[A-Z0-9_]*$' |
+	     sort -u) ; do
+	define_bool "$var" "n"
+done
+set -f
 
 DEFAULT=""
 if [ "$1" = "-d" ] ; then

^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: linux-2.4.6-pre6: numerous dep_{bool,tristate} $CONFIG_ARCH_xxx bugs
@ 2001-06-30  4:35 Adam J. Richter
  2001-06-30  7:26 ` Alan Cox
  0 siblings, 1 reply; 33+ messages in thread
From: Adam J. Richter @ 2001-06-30  4:35 UTC (permalink / raw)
  To: alan, rmk; +Cc: kaos, linux-kernel

>> = Keith Owens
>  = Alan Cox

>> I'd rather that we fixed dep_* so that undefined symbols were treated as
>> 'n', just like the makefiles treat undefined symbols.
>
>That isnt a simple change. dep_tristate is used both to express 'need this'
>and also 'conflicts with'. Those are ambiguous. You'd need to extend the
>syntax say by adding  ${FOO:N} syntax 

	I do not understand what you (Alan) mean by the "'conflicts with'"
usage.  I do not believe there is any way to directly use dep_* to express
that a "y" answer to some feature requires "n" or even "m" for another
feature.

	Regarding Jeff Garzik's suggestion to just "Define CONFIG_ARCH_xxx
in various arches where needed", the problem primarily arises from
CONFIG_ variables from other architectures, so you're talking about
adding the same set of lines for every architecture, and they are
changes that would have to be maintained.  That wouldn't be the
end of the world, but it would be another instance of people doing
work that computers can do for them.

	Implementing Keith's suggestion will still require changes to
the Config.in files, to put quotation marks around things like
$CONFIG_SPARC64.  Otherwise, the shell will treat the undefined
variable is if it were not provided, as opposed to turning it into
an emptry string argument.  I could put together a patch to do this
if there is a consensus that it is the preferred solution.

	In the meantime, I have implemented the following small kludge
in scripts/Configure that extracts all variables from arch/*/config.in
and sets them all to "n" before reading in their default values.
I only processed the variables in arch/*/config.in so that I could
assume that the list of variables is small and because defaulting the
variables to "n" makes it slightly harder to detect bugs where Config.in
scripts look at the values of variables that have not yet been set.
Because some platforms use variables that do not being with CONFIG_ARCH
(e.g., CONFIG_SPARC64, CONFIG_X86), I could not just filter for CONFIG_ARCH_*.
I could mail Linus a shell script to clean this up too if that were
desired (a patch would be far too messy).  Anyhow, the change seems to
work, although I have been bumping into a lot of other build errors
with linux-2.4.6-pre6, partly as a result of gcc-3.0 pickiness, so
I have yet to see the build complete.  It is a kludge, but at least
it's a solution.  I'm not particularly enamored of any one approach
in this case; I just want it resolved in a way that is unlikely to
lead to recurrence.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."


--- linux-2.4.6-pre6/scripts/Configure	Sat Dec 30 18:16:13 2000
+++ linux/scripts/Configure	Fri Jun 29 15:18:14 2001
@@ -48,6 +48,9 @@
 #
 # 24 January 1999, Michael Elizabeth Chastain, <mec@shout.net>
 # - Improve the exit message (Jeff Ronne).
+#
+# 29 June 2001, Adam J. Richter, <adam@yggdrasil.com>
+# - Default all CONFIG_ARCH_* and CONFIG_X86 to "n"
 
 #
 # Make sure we're really running bash.
@@ -531,6 +534,16 @@
 echo " * Automatically generated C config: don't edit" >> $CONFIG_H
 echo " */" >> $CONFIG_H
 echo "#define AUTOCONF_INCLUDED" >> $CONFIG_H
+
+# Ensure all unselected architectures are set to "n" rather than being
+# undefined, so that dep_bool and dep_tristate properly detect their absense.
+# Really, CONFIG_X86 should be CONFIG_ARCH_X86.
+set +f
+for arch in CONFIG_X86 $(cat arch/*/config.in | tr '   $"' '\n\n\n' |
+              egrep ^CONFIG_ARCH_ | sort -u) ; do
+	define_bool "$arch" "n"
+done
+set -f
 
 DEFAULT=""
 if [ "$1" = "-d" ] ; then

^ permalink raw reply	[flat|nested] 33+ messages in thread
* linux-2.4.6-pre6: numerous dep_{bool,tristate} $CONFIG_ARCH_xxx bugs
@ 2001-06-29 14:10 Adam J. Richter
  2001-06-29 14:21 ` Keith Owens
  2001-06-29 14:30 ` Jeff Garzik
  0 siblings, 2 replies; 33+ messages in thread
From: Adam J. Richter @ 2001-06-29 14:10 UTC (permalink / raw)
  To: linux-kernel


	The Config.in files in linux-2.4.6-pre6 have at least 28 cases
where a dep_bool or dep_tristate of the following form:

	dep_bool CONFIG_SOMETHING $CONFIG_ARCH_somearch

	The problem with this is that, unlike most configuration variables,
the $CONFIG_ARCH_xxxx variables are often not set to "n" when they are
not selected (they are often just not defined, for example, when they
are archectures for a completely different CPU type).  When those variables
are not defined, that is essentially equivalent to passing "y" to dep_bool,
and the user is incorrectly asked about these facilities.

	I will put together patch to convert this to ugly but correct
"if then; ... ; fi" statements later today if nobody has any better
suggestions.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2001-07-02 16:29 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-30 14:57 linux-2.4.6-pre6: numerous dep_{bool,tristate} $CONFIG_ARCH_xxx bugs Adam J. Richter
2001-06-30 15:01 ` Russell King
2001-06-30 20:36   ` 2.4.6p6: " Riley Williams
2001-07-01  3:00     ` Keith Owens
2001-07-01 23:04       ` [PATCH] Re: 2.4.6p6: " Riley Williams
2001-07-02  0:39         ` Keith Owens
2001-07-02  7:16           ` Riley Williams
2001-07-02  7:23             ` Keith Owens
2001-07-02  8:25               ` Riley Williams
2001-07-02  9:41                 ` Russell King
2001-07-02 12:40                   ` Riley Williams
2001-07-02 15:03                     ` Russell King
2001-07-02 16:28                       ` Nicolas Pitre
2001-07-01  2:39   ` linux-2.4.6-pre6: numerous " Keith Owens
  -- strict thread matches above, loose matches on Subject: below --
2001-06-30 13:32 Adam J. Richter
2001-06-30  9:38 Adam J. Richter
2001-06-30  4:40 Adam J. Richter
2001-06-30  7:23 ` Alan Cox
2001-06-30  4:35 Adam J. Richter
2001-06-30  7:26 ` Alan Cox
2001-06-30  9:20   ` Russell King
2001-06-30 11:43     ` Alan Cox
2001-06-30 11:58       ` Russell King
2001-06-30 12:01         ` Alan Cox
2001-06-30 12:02           ` Russell King
2001-06-30 11:45     ` Keith Owens
2001-06-30 12:10       ` Russell King
2001-06-29 14:10 Adam J. Richter
2001-06-29 14:21 ` Keith Owens
2001-06-29 14:30   ` Russell King
2001-06-29 14:41     ` Keith Owens
2001-06-29 15:19     ` Alan Cox
2001-06-29 14:30 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).