public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Build Failure
       [not found] <BANLkTikBm0gmNd8oQ6CN+cAEbYhWEGvWPA@mail.gmail.com>
@ 2011-04-30 14:31 ` Colin Minihan
  2011-04-30 16:10   ` Andy Walls
  2011-05-01 11:50   ` Vincent McIntyre
  0 siblings, 2 replies; 4+ messages in thread
From: Colin Minihan @ 2011-04-30 14:31 UTC (permalink / raw)
  To: linux-media

On Ubuntu 10.04 attempting to run

git clone git://linuxtv.org/media_build.git
cd media_build
./check_needs.pl
make -C linux/ download
make -C linux/ untar
make stagingconfig
make

 results in the following failure
...
  CC [M]  /home/colm/media_build/v4l/lirc_zilog.o
/home/colm/media_build/v4l/lirc_zilog.c: In function 'destroy_rx_kthread':
/home/colm/media_build/v4l/lirc_zilog.c:238: error: implicit
declaration of function 'IS_ERR_OR_NULL'
make[3]: *** [/home/colm/media_build/v4l/lirc_zilog.o] Error 1
make[2]: *** [_module_/home/colm/media_build/v4l] Error 2
make[2]: Leaving directory `/usr/src/linux-headers-2.6.32-31-generic'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home/colm/media_build/v4l'
make: *** [all] Error 2

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

* Re: Build Failure
  2011-04-30 14:31 ` Build Failure Colin Minihan
@ 2011-04-30 16:10   ` Andy Walls
  2011-05-01  1:28     ` Mauro Carvalho Chehab
  2011-05-01 11:50   ` Vincent McIntyre
  1 sibling, 1 reply; 4+ messages in thread
From: Andy Walls @ 2011-04-30 16:10 UTC (permalink / raw)
  To: Colin Minihan; +Cc: linux-media

On Sat, 2011-04-30 at 10:31 -0400, Colin Minihan wrote:
> On Ubuntu 10.04 attempting to run
> 
> git clone git://linuxtv.org/media_build.git
> cd media_build
> ./check_needs.pl
> make -C linux/ download
> make -C linux/ untar
> make stagingconfig
> make
> 
>  results in the following failure
> ...
>   CC [M]  /home/colm/media_build/v4l/lirc_zilog.o
> /home/colm/media_build/v4l/lirc_zilog.c: In function 'destroy_rx_kthread':
> /home/colm/media_build/v4l/lirc_zilog.c:238: error: implicit
> declaration of function 'IS_ERR_OR_NULL'

Well, IS_ERR_OR_NULL() went into the kernel in December 2009:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=603c4ba96be998a8dd7a6f9b23681c49acdf4b64

so it should be in kernel version 2.6.33 and later.

If you don't want to generate a patch for the media_build backward
compatability build system, you can probably just patch your kernel
header file or trivially hack the function it into 

	drivers/staging/lirc/lirc_zilog.c

to get past your current build error.  But I suspect you'll run into
more errors.  When I make changes to a module (like lirc_zilog.c), I
tend to use the latest kernel interfaces at the time of the changes.

If you don't need lirc_zilog.ko built, then configure the build system
to not build the module.

Regards,
Andy

> make[3]: *** [/home/colm/media_build/v4l/lirc_zilog.o] Error 1
> make[2]: *** [_module_/home/colm/media_build/v4l] Error 2
> make[2]: Leaving directory `/usr/src/linux-headers-2.6.32-31-generic'
> make[1]: *** [default] Error 2
> make[1]: Leaving directory `/home/colm/media_build/v4l'
> make: *** [all] Error 2
> --



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

* Re: Build Failure
  2011-04-30 16:10   ` Andy Walls
@ 2011-05-01  1:28     ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 4+ messages in thread
From: Mauro Carvalho Chehab @ 2011-05-01  1:28 UTC (permalink / raw)
  To: Colin Minihan; +Cc: Andy Walls, linux-media

Em 30-04-2011 13:10, Andy Walls escreveu:
> On Sat, 2011-04-30 at 10:31 -0400, Colin Minihan wrote:
>> On Ubuntu 10.04 attempting to run
>>
>> git clone git://linuxtv.org/media_build.git
>> cd media_build
>> ./check_needs.pl
>> make -C linux/ download
>> make -C linux/ untar
>> make stagingconfig
>> make
>>
>>  results in the following failure
>> ...
>>   CC [M]  /home/colm/media_build/v4l/lirc_zilog.o
>> /home/colm/media_build/v4l/lirc_zilog.c: In function 'destroy_rx_kthread':
>> /home/colm/media_build/v4l/lirc_zilog.c:238: error: implicit
>> declaration of function 'IS_ERR_OR_NULL'
> 
> Well, IS_ERR_OR_NULL() went into the kernel in December 2009:
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=603c4ba96be998a8dd7a6f9b23681c49acdf4b64
> 
> so it should be in kernel version 2.6.33 and later.

This is defined at include/linux/err.h as:

#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)

static inline long __must_check IS_ERR_OR_NULL(const void *ptr)
{
	return !ptr || IS_ERR_VALUE((unsigned long)ptr);
}

> 
> If you don't want to generate a patch for the media_build backward
> compatability build system, you can probably just patch your kernel
> header file or trivially hack the function it into 
> 
> 	drivers/staging/lirc/lirc_zilog.c
> 
> to get past your current build error.  But I suspect you'll run into
> more errors.  When I make changes to a module (like lirc_zilog.c), I
> tend to use the latest kernel interfaces at the time of the changes.
> 
> If you don't need lirc_zilog.ko built, then configure the build system
> to not build the module.

To make it work, it is probably as simple as adding this into v4l/compat.h:

#if NEED_IS_ERR_OR_NULL
#define IS_ERR_OR_NULL(ptr) (!(ptr) || IS_ERR_VALUE((unsigned long)(ptr)))
#endif


And:

check_file_for_func("include/linux/err.h", "IS_ERR_OR_NULL", "NEED_IS_ERR_OR_NULL");

at v4l/scripts/make_config_compat.pl,

as the enclosed (not tested) patch.

Please test it and, if it wors, ping us for its inclusion at media_tree.git. Otherwise,
feel free to fix it and submit us the fix.

Thanks!
Mauro

---

Add backward support for IS_ERR_OR_NULL

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

diff --git a/v4l/compat.h b/v4l/compat.h
index bc8d71f..9dbe54f 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -796,4 +796,8 @@ static inline int snd_ctl_enum_info(struct snd_ctl_elem_info *info, unsigned int
 #define usleep_range(min, max) msleep(min/1000)
 #endif
 
+#if NEED_IS_ERR_OR_NULL
+#define IS_ERR_OR_NULL(ptr) (!(ptr) || IS_ERR_VALUE((unsigned long)(ptr)))
+#endif
+
 #endif /*  _COMPAT_H */
diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl
index a426134..01f6c30 100755
--- a/v4l/scripts/make_config_compat.pl
+++ b/v4l/scripts/make_config_compat.pl
@@ -492,6 +492,7 @@ sub check_other_dependencies()
 	check_file_for_func("include/sound/control.h", "snd_ctl_enum_info", "NEED_SND_CTL_ENUM_INFO");
 	check_file_for_func("include/linux/sysfs.h", "sysfs_attr_init", "NEED_SYSFS_ATTR_INIT");
 	check_file_for_func("include/linux/delay.h", "usleep_range", "NEED_USLEEP_RANGE");
+	check_file_for_func("include/linux/err.h", "IS_ERR_OR_NULL", "NEED_IS_ERR_OR_NULL");
 }
 
 # Do the basic rules

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

* Re: Build Failure
  2011-04-30 14:31 ` Build Failure Colin Minihan
  2011-04-30 16:10   ` Andy Walls
@ 2011-05-01 11:50   ` Vincent McIntyre
  1 sibling, 0 replies; 4+ messages in thread
From: Vincent McIntyre @ 2011-05-01 11:50 UTC (permalink / raw)
  To: Colin Minihan; +Cc: linux-media

On 5/1/11, Colin Minihan <colin.minihan@gmail.com> wrote:
> On Ubuntu 10.04 attempting to run
>
> git clone git://linuxtv.org/media_build.git
> cd media_build
> ./check_needs.pl
> make -C linux/ download
> make -C linux/ untar
> make stagingconfig
> make
>
>  results in the following failure
> ...

I see this too (platform details below) but only if I do the 'make
stagingconfig' step
which I don't usually need to. The patch Mauro supplied worked for me;
I just edited
the two files involved and reran 'make' at the point at which the
build had failed.
v4l/config-compat.h had the expected extra #define in it and the build
completed ok.
I haven't tested the resulting module as I don't have the relevant hardware.

Cheers
Vince

platform details:

$ cat /etc/issue
Ubuntu 10.04.2 LTS \n \l
$ uname -a
Linux ubuntu 2.6.32-31-generic #61-Ubuntu SMP Fri Apr 8 18:24:35 UTC
2011 i686 GNU/Linux
$ cat v4l/.version
VERSION=2
PATCHLEVEL:=6
SUBLEVEL:=32
KERNELRELEASE:=2.6.32-31-generic

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

end of thread, other threads:[~2011-05-01 11:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <BANLkTikBm0gmNd8oQ6CN+cAEbYhWEGvWPA@mail.gmail.com>
2011-04-30 14:31 ` Build Failure Colin Minihan
2011-04-30 16:10   ` Andy Walls
2011-05-01  1:28     ` Mauro Carvalho Chehab
2011-05-01 11:50   ` Vincent McIntyre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox