All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bjørn Mork" <bjorn@mork.no>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	USB list <linux-usb@vger.kernel.org>,
	linux-kernel@vger.kernel.org,
	Linux-Next <linux-next@vger.kernel.org>,
	linux-kbuild <linux-kbuild@vger.kernel.org>,
	Linux/m68k <linux-m68k@vger.kernel.org>
Subject: Re: [-next] FATAL: drivers/gpu/drm/udl/udl: sizeof(struct usb_device_id)=24 is not a modulo of the size of section __mod_usb_device_table=44.
Date: Sun, 17 Jun 2012 16:00:57 +0200	[thread overview]
Message-ID: <87fw9urqau.fsf@nemi.mork.no> (raw)
In-Reply-To: <m2bokjb6tv.fsf@igel.home> (Andreas Schwab's message of "Sat, 16 Jun 2012 17:43:40 +0200")

Andreas Schwab <schwab@linux-m68k.org> writes:
> Bjørn Mork <bjorn@mork.no> writes:
>
>> AFAIK (which admittedly is not much wrt cross building) there is no way
>> we can make the host built file2alias know the proper aligment for the
>> structure in the target built modules.  That's the background for this
>> fix: 
>>
>> commit 4ce6efed48d736e3384c39ff87bda723e1f8e041
>> Author: Sam Ravnborg <sam@uranus.ravnborg.org>
>> Date:   Sun Mar 23 21:38:54 2008 +0100
>>
>>     kbuild: soften modpost checks when doing cross builds
>
> This is not a fix in any sense of the word.  modpost can only work
> properly if its view of the device_id structures matches *exactly* that
> of the target.

You are absolutely correct, of course.  I am starting to believe Greg is
correct.  Cross building works mostly by pure luck :-)

I found that the reason the change I referred to above didn't kick in
was because CONFIG_DEBUG_SECTION_MISMATCH was set, causing modpost to be
called from scripts/Makefile.build without the "-c" option:

 # Do section mismatch analysis for each module/built-in.o
 ifdef CONFIG_DEBUG_SECTION_MISMATCH
   cmd_secanalysis = ; scripts/mod/modpost $@
 endif


But as you point out: The whole "soften modpost check" concept is bogus.
It just cannot work.  And I just verified it doing a m68k allmodconfig
build without CONFIG_DEBUG_SECTION_MISMATCH.  modpost will bail out
unless host and target aligment matches:

  scripts/mod/modpost -m -a -o /usr/local/src/build-tmp/linux/Module.symvers    -S  -c -s
drivers/media/video/gspca/gspca_sunplus: struct usb_device_id is 24 bytes.  The last of 55 is:
0x04 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
FATAL: drivers/media/video/gspca/gspca_sunplus: struct usb_device_id is not terminated with a NULL entry!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2


So the prosed fix from Greg is certainly the correct one, until someone
rewrites modpost to be completely cross build safe.


Bjørn

WARNING: multiple messages have this Message-ID (diff)
From: "Bjørn Mork" <bjorn@mork.no>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	USB list <linux-usb@vger.kernel.org>,
	linux-kernel@vger.kernel.org,
	Linux-Next <linux-next@vger.kernel.org>,
	linux-kbuild <linux-kbuild@vger.kernel.org>,
	Linux/m68k <linux-m68k@vger.kernel.org>
Subject: Re: [-next] FATAL: drivers/gpu/drm/udl/udl: sizeof(struct usb_device_id)=24 is not a modulo of the size of section __mod_usb_device_table=44.
Date: Sun, 17 Jun 2012 16:00:57 +0200	[thread overview]
Message-ID: <87fw9urqau.fsf@nemi.mork.no> (raw)
In-Reply-To: <m2bokjb6tv.fsf@igel.home> (Andreas Schwab's message of "Sat, 16 Jun 2012 17:43:40 +0200")

Andreas Schwab <schwab@linux-m68k.org> writes:
> Bjørn Mork <bjorn@mork.no> writes:
>
>> AFAIK (which admittedly is not much wrt cross building) there is no way
>> we can make the host built file2alias know the proper aligment for the
>> structure in the target built modules.  That's the background for this
>> fix: 
>>
>> commit 4ce6efed48d736e3384c39ff87bda723e1f8e041
>> Author: Sam Ravnborg <sam@uranus.ravnborg.org>
>> Date:   Sun Mar 23 21:38:54 2008 +0100
>>
>>     kbuild: soften modpost checks when doing cross builds
>
> This is not a fix in any sense of the word.  modpost can only work
> properly if its view of the device_id structures matches *exactly* that
> of the target.

You are absolutely correct, of course.  I am starting to believe Greg is
correct.  Cross building works mostly by pure luck :-)

I found that the reason the change I referred to above didn't kick in
was because CONFIG_DEBUG_SECTION_MISMATCH was set, causing modpost to be
called from scripts/Makefile.build without the "-c" option:

 # Do section mismatch analysis for each module/built-in.o
 ifdef CONFIG_DEBUG_SECTION_MISMATCH
   cmd_secanalysis = ; scripts/mod/modpost $@
 endif


But as you point out: The whole "soften modpost check" concept is bogus.
It just cannot work.  And I just verified it doing a m68k allmodconfig
build without CONFIG_DEBUG_SECTION_MISMATCH.  modpost will bail out
unless host and target aligment matches:

  scripts/mod/modpost -m -a -o /usr/local/src/build-tmp/linux/Module.symvers    -S  -c -s
drivers/media/video/gspca/gspca_sunplus: struct usb_device_id is 24 bytes.  The last of 55 is:
0x04 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
FATAL: drivers/media/video/gspca/gspca_sunplus: struct usb_device_id is not terminated with a NULL entry!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2


So the prosed fix from Greg is certainly the correct one, until someone
rewrites modpost to be completely cross build safe.


Bjørn
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-06-17 14:01 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15 17:42 [-next] FATAL: drivers/gpu/drm/udl/udl: sizeof(struct usb_device_id)=24 is not a modulo of the size of section __mod_usb_device_table=44 Geert Uytterhoeven
2012-06-15 20:10 ` Greg Kroah-Hartman
2012-06-15 21:02   ` Geert Uytterhoeven
2012-06-15 21:02     ` Geert Uytterhoeven
2012-06-15 23:12     ` Greg Kroah-Hartman
2012-06-15 23:12       ` Greg Kroah-Hartman
2012-06-16 13:23       ` Bjørn Mork
2012-06-16 15:43         ` Andreas Schwab
2012-06-16 15:43           ` Andreas Schwab
2012-06-17 14:00           ` Bjørn Mork [this message]
2012-06-17 14:00             ` Bjørn Mork
2012-06-17 15:42             ` Andreas Schwab
2012-06-25 12:22             ` [PATCH] mod/file2alias: make modalias generation safe for cross compiling Andreas Schwab
2012-06-25 20:32               ` Geert Uytterhoeven
2012-06-25 20:32                 ` Geert Uytterhoeven
2012-06-25 21:43                 ` Andreas Schwab
2012-06-25 21:43                   ` Andreas Schwab
2012-06-26  5:00               ` Sam Ravnborg
2012-06-26 13:27                 ` [PATCH v2] " Andreas Schwab
2012-06-16 18:33         ` [-next] FATAL: drivers/gpu/drm/udl/udl: sizeof(struct usb_device_id)=24 is not a modulo of the size of section __mod_usb_device_table=44 Philippe De Muyter
2012-06-16 19:11         ` Greg Kroah-Hartman
2012-06-16 19:30           ` Geert Uytterhoeven
2012-06-16 19:30             ` Geert Uytterhoeven
2012-06-16 18:51       ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fw9urqau.fsf@nemi.mork.no \
    --to=bjorn@mork.no \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.