mailing list of musl libc
 help / color / mirror / code / Atom feed
* unknown type name 'loff_t'
@ 2013-01-23 17:33 Alexander Stadler
  2013-01-23 17:37 ` Rich Felker
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Stadler @ 2013-01-23 17:33 UTC (permalink / raw)
  To: musl

Thanks for your fast responses.

The other error I'm currently running into is

make[4]: Entering directory `/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/uboot-envtools-2012.04.01'
mips-openwrt-linux-musl-gcc -Wall -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -mno-branch-likely -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float  -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/include  crc32.c fw_env.c fw_env_main.c -o fw_printenv
fw_env.c:643:55: error: unknown type name 'loff_t'
fw_env.c: In function 'flash_read_buf':
fw_env.c:680:2: error: unknown type name 'loff_t'
fw_env.c:713:3: warning: implicit declaration of function 'flash_bad_block' [-Wimplicit-function-declaration]
fw_env.c: In function 'flash_write_buf':
fw_env.c:777:2: error: unknown type name 'loff_t'
make[4]: *** [fw_printenv] Error 1
make[4]: Leaving directory `/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/uboot-envtools-2012.04.01'

I've found

linux/include/linux/types.h:

#if defined(__GNUC__)
typedef __kernel_loff_t         loff_t;
#endif

and

linux/include/asm-generic/posix_types.h:

typedef long long       __kernel_loff_t;

but

arch/arm/include/asm/posix_types.h:
arch/x86/include/asm/posix_types_32.h:
arch/x86/include/asm/posix_types_64.h:

#ifdef __GNUC__
typedef long long               __kernel_loff_t;
#endif

So is this something which should be changed at openwrt, upstream, or your library?
My research was limited on that because I'm currently not experienced enough to understand why long long got typedefed. And works in uClibc (does this really go true for #if defined(__GNUC__) in opposite to yours?).

Alex


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

* Re: unknown type name 'loff_t'
  2013-01-23 17:33 unknown type name 'loff_t' Alexander Stadler
@ 2013-01-23 17:37 ` Rich Felker
  2013-01-24 18:55   ` Alexander Stadler
  2013-01-24 18:57   ` unknown type name 'loff_t' Alexander Stadler
  0 siblings, 2 replies; 8+ messages in thread
From: Rich Felker @ 2013-01-23 17:37 UTC (permalink / raw)
  To: musl

On Wed, Jan 23, 2013 at 06:33:42PM +0100, Alexander Stadler wrote:
> Thanks for your fast responses.
> 
> The other error I'm currently running into is
> 
> make[4]: Entering directory `/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/uboot-envtools-2012.04.01'
> mips-openwrt-linux-musl-gcc -Wall -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -mno-branch-likely -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float  -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/include  crc32.c fw_env.c fw_env_main.c -o fw_printenv
> fw_env.c:643:55: error: unknown type name 'loff_t'
> fw_env.c: In function 'flash_read_buf':
> fw_env.c:680:2: error: unknown type name 'loff_t'
> fw_env.c:713:3: warning: implicit declaration of function 'flash_bad_block' [-Wimplicit-function-declaration]
> fw_env.c: In function 'flash_write_buf':
> fw_env.c:777:2: error: unknown type name 'loff_t'
> make[4]: *** [fw_printenv] Error 1
> make[4]: Leaving directory `/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/uboot-envtools-2012.04.01'

Where is loff_t being used? It's probably the wrong type to use. The
only APIs loff_t is to be used with are under _GNU_SOURCE, so if you
don't need -D_GNU_SOURCE to get the functions, it's doubtful that
loff_t should be used. These functions are in fcntl.h, and it will
#define loff_t off_t when _GNU_SOURCE is defined, so either
-D_GNU_SOURCE or -Dloff_t=off_t would be a workaround, but I think the
issue should be investigated to determine if there's code that needs
to be fixed or if there are other circumstances under which loff_t
should be exposed by musl.

Rich


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

* Re: unknown type name 'loff_t'
  2013-01-23 17:37 ` Rich Felker
@ 2013-01-24 18:55   ` Alexander Stadler
  2013-01-24 19:47     ` Szabolcs Nagy
  2013-01-24 18:57   ` unknown type name 'loff_t' Alexander Stadler
  1 sibling, 1 reply; 8+ messages in thread
From: Alexander Stadler @ 2013-01-24 18:55 UTC (permalink / raw)
  To: musl

Am 23.01.2013 18:37, schrieb Rich Felker:
> On Wed, Jan 23, 2013 at 06:33:42PM +0100, Alexander Stadler wrote:
>> Thanks for your fast responses.
>>
>> The other error I'm currently running into is
>>
>> make[4]: Entering directory `/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/uboot-envtools-2012.04.01'
>> mips-openwrt-linux-musl-gcc -Wall -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -mno-branch-likely -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float  -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/include  crc32.c fw_env.c fw_env_main.c -o fw_printenv
>> fw_env.c:643:55: error: unknown type name 'loff_t'
>> fw_env.c: In function 'flash_read_buf':
>> fw_env.c:680:2: error: unknown type name 'loff_t'
>> fw_env.c:713:3: warning: implicit declaration of function 'flash_bad_block' [-Wimplicit-function-declaration]
>> fw_env.c: In function 'flash_write_buf':
>> fw_env.c:777:2: error: unknown type name 'loff_t'
>> make[4]: *** [fw_printenv] Error 1
>> make[4]: Leaving directory `/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/uboot-envtools-2012.04.01'
> 
> Where is loff_t being used? It's probably the wrong type to use. The
> only APIs loff_t is to be used with are under _GNU_SOURCE, so if you
> don't need -D_GNU_SOURCE to get the functions, it's doubtful that
> loff_t should be used. These functions are in fcntl.h, and it will
> #define loff_t off_t when _GNU_SOURCE is defined, so either
> -D_GNU_SOURCE or -Dloff_t=off_t would be a workaround, but I think the
> issue should be investigated to determine if there's code that needs
> to be fixed or if there are other circumstances under which loff_t
> should be exposed by musl.
> 
> Rich

It's used in
http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=tools/env/fw_env.c;h=37b60b80a7624566d9ecefdd04c0658134bd654d;hb=HEAD
where (you were absolutely right) a #include <fcntl.h> exists.
And -D_GNU_SOURCE helped. Thank you!

Happy about that, unfortunately there will come up much more things I think, as seconds later the next undeclared error popped up..

(when compiling mtd
mips-openwrt-linux-musl-gcc -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -mno-branch-likely -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -Dtarget_ar71xx=1 -Wall -DFIS_SUPPORT=1  -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/include  -Wall   -c -o fis.o fis.c
fis.c: In function 'fis_open':
fis.c:80:64: error: 'MAP_LOCKED' undeclared (first use in this function)
fis.c:80:64: note: each undeclared identifier is reported only once for each function it appears in

So I wonder why uClibc? seems to include these things.
But there are so many mman.h's and the one referenced from fis.c (sys/mman.h) seems not to have the define, but otheres have.. .
How could a proper procedure look like to include these things, and on which side of the code this should go is what I currently don't understand at all. I just don't want to bother you if its bad behaviour of Uclibc which enabled this things to work. But than propably an generic workaround could be found.
)

Alex


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

* Re: unknown type name 'loff_t'
  2013-01-23 17:37 ` Rich Felker
  2013-01-24 18:55   ` Alexander Stadler
@ 2013-01-24 18:57   ` Alexander Stadler
  2013-01-24 19:19     ` Rich Felker
  1 sibling, 1 reply; 8+ messages in thread
From: Alexander Stadler @ 2013-01-24 18:57 UTC (permalink / raw)
  To: musl

Am 23.01.2013 18:37, schrieb Rich Felker:
> On Wed, Jan 23, 2013 at 06:33:42PM +0100, Alexander Stadler wrote:
>> Thanks for your fast responses.
>>
>> The other error I'm currently running into is
>>
>> make[4]: Entering directory `/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/uboot-envtools-2012.04.01'
>> mips-openwrt-linux-musl-gcc -Wall -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -mno-branch-likely -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float  -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/include  crc32.c fw_env.c fw_env_main.c -o fw_printenv
>> fw_env.c:643:55: error: unknown type name 'loff_t'
>> fw_env.c: In function 'flash_read_buf':
>> fw_env.c:680:2: error: unknown type name 'loff_t'
>> fw_env.c:713:3: warning: implicit declaration of function 'flash_bad_block' [-Wimplicit-function-declaration]
>> fw_env.c: In function 'flash_write_buf':
>> fw_env.c:777:2: error: unknown type name 'loff_t'
>> make[4]: *** [fw_printenv] Error 1
>> make[4]: Leaving directory `/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/uboot-envtools-2012.04.01'
> 
> Where is loff_t being used? It's probably the wrong type to use. The
> only APIs loff_t is to be used with are under _GNU_SOURCE, so if you
> don't need -D_GNU_SOURCE to get the functions, it's doubtful that
> loff_t should be used. These functions are in fcntl.h, and it will
> #define loff_t off_t when _GNU_SOURCE is defined, so either
> -D_GNU_SOURCE or -Dloff_t=off_t would be a workaround, but I think the
> issue should be investigated to determine if there's code that needs
> to be fixed or if there are other circumstances under which loff_t
> should be exposed by musl.
> 
> Rich

It's used in
http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=tools/env/fw_env.c;h=37b60b80a7624566d9ecefdd04c0658134bd654d;hb=HEAD
where (you were absolutely right) a #include <fcntl.h> exists.
And -D_GNU_SOURCE helped. Thank you!

Happy about that, unfortunately there will come up much more things I think, as seconds later the next undeclared error popped up..

(when compiling mtd
mips-openwrt-linux-musl-gcc -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -mno-branch-likely -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -Dtarget_ar71xx=1 -Wall -DFIS_SUPPORT=1  -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/include  -Wall   -c -o fis.o fis.c
fis.c: In function 'fis_open':
fis.c:80:64: error: 'MAP_LOCKED' undeclared (first use in this function)
fis.c:80:64: note: each undeclared identifier is reported only once for each function it appears in

So I wonder why uClibc? seems to include these things.
But there are so many mman.h's and the one referenced from fis.c (sys/mman.h) seems not to have the define, but otheres have.. .
How could a proper procedure look like to include these things, and on which side of the code this should go is what I currently don't understand at all. I just don't want to bother you if its bad behaviour of Uclibc which enabled this things to work. But than propably an generic workaround could be found.
)

Alex


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

* Re: unknown type name 'loff_t'
  2013-01-24 18:57   ` unknown type name 'loff_t' Alexander Stadler
@ 2013-01-24 19:19     ` Rich Felker
  2013-01-24 19:28       ` Alexander Stadler
  0 siblings, 1 reply; 8+ messages in thread
From: Rich Felker @ 2013-01-24 19:19 UTC (permalink / raw)
  To: musl

On Thu, Jan 24, 2013 at 07:57:28PM +0100, Alexander Stadler wrote:
> Am 23.01.2013 18:37, schrieb Rich Felker:
> > On Wed, Jan 23, 2013 at 06:33:42PM +0100, Alexander Stadler wrote:
> >> Thanks for your fast responses.
> >>
> >> The other error I'm currently running into is
> >>
> >> make[4]: Entering directory `/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/uboot-envtools-2012.04.01'
> >> mips-openwrt-linux-musl-gcc -Wall -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -mno-branch-likely -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float  -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/include  crc32.c fw_env.c fw_env_main.c -o fw_printenv
> >> fw_env.c:643:55: error: unknown type name 'loff_t'
> >> fw_env.c: In function 'flash_read_buf':
> >> fw_env.c:680:2: error: unknown type name 'loff_t'
> >> fw_env.c:713:3: warning: implicit declaration of function 'flash_bad_block' [-Wimplicit-function-declaration]
> >> fw_env.c: In function 'flash_write_buf':
> >> fw_env.c:777:2: error: unknown type name 'loff_t'
> >> make[4]: *** [fw_printenv] Error 1
> >> make[4]: Leaving directory `/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/uboot-envtools-2012.04.01'
> > 
> > Where is loff_t being used? It's probably the wrong type to use. The
> > only APIs loff_t is to be used with are under _GNU_SOURCE, so if you
> > don't need -D_GNU_SOURCE to get the functions, it's doubtful that
> > loff_t should be used. These functions are in fcntl.h, and it will
> > #define loff_t off_t when _GNU_SOURCE is defined, so either
> > -D_GNU_SOURCE or -Dloff_t=off_t would be a workaround, but I think the
> > issue should be investigated to determine if there's code that needs
> > to be fixed or if there are other circumstances under which loff_t
> > should be exposed by musl.
> > 
> > Rich
> 
> It's used in
> http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=tools/env/fw_env.c;h=37b60b80a7624566d9ecefdd04c0658134bd654d;hb=HEAD
> where (you were absolutely right) a #include <fcntl.h> exists.
> And -D_GNU_SOURCE helped. Thank you!

It looks like some ioctl interfaces also request loff_t in their
official usage, so musl should do something to ensure it's exposed for
ioctl. I'm not sure however what the best way is. Simply adding

#define loff_t off_t

to sys/ioctl.h is not sufficient because off_t might not be defined,
so another header would need to be included to get off_t. Note that
sys/ioctl.h is not under the domain of any modern standard, so it
would not be a horrible offense to make it include extra junk if we
need to..

> Happy about that, unfortunately there will come up much more things
> I think, as seconds later the next undeclared error popped up..

OK, I'll take a look.

> (when compiling mtd
> mips-openwrt-linux-musl-gcc -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -mno-branch-likely -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -Dtarget_ar71xx=1 -Wall -DFIS_SUPPORT=1  -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/include  -Wall   -c -o fis.o fis.c
> fis.c: In function 'fis_open':
> fis.c:80:64: error: 'MAP_LOCKED' undeclared (first use in this function)
> fis.c:80:64: note: each undeclared identifier is reported only once for each function it appears in
> 
> So I wonder why uClibc? seems to include these things. But there are
> so many mman.h's and the one referenced from fis.c (sys/mman.h)
> seems not to have the define, but otheres have.. . How could a
> proper procedure look like to include these things, and on which
> side of the code this should go is what I currently don't understand
> at all. I just don't want to bother you if its bad behaviour of
> Uclibc which enabled this things to work. But than propably an
> generic workaround could be found.

MAP_LOCKED is a Linux extension to mmap that somehow never got added
to musl when the others were added. Its definition probably varies
per-arch. I'll see if I can get somebody to find what's needed to add
it correctly for all archs.

Rich


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

* Re: unknown type name 'loff_t'
  2013-01-24 19:19     ` Rich Felker
@ 2013-01-24 19:28       ` Alexander Stadler
  0 siblings, 0 replies; 8+ messages in thread
From: Alexander Stadler @ 2013-01-24 19:28 UTC (permalink / raw)
  To: musl

Am 24.01.2013 20:19, schrieb Rich Felker:
> On Thu, Jan 24, 2013 at 07:57:28PM +0100, Alexander Stadler wrote:
>> Am 23.01.2013 18:37, schrieb Rich Felker:
>>> On Wed, Jan 23, 2013 at 06:33:42PM +0100, Alexander Stadler wrote:
>>>> Thanks for your fast responses.
>>>>
>>>> The other error I'm currently running into is
>>>>
>>>> make[4]: Entering directory `/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/uboot-envtools-2012.04.01'
>>>> mips-openwrt-linux-musl-gcc -Wall -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -mno-branch-likely -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float  -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/include  crc32.c fw_env.c fw_env_main.c -o fw_printenv
>>>> fw_env.c:643:55: error: unknown type name 'loff_t'
>>>> fw_env.c: In function 'flash_read_buf':
>>>> fw_env.c:680:2: error: unknown type name 'loff_t'
>>>> fw_env.c:713:3: warning: implicit declaration of function 'flash_bad_block' [-Wimplicit-function-declaration]
>>>> fw_env.c: In function 'flash_write_buf':
>>>> fw_env.c:777:2: error: unknown type name 'loff_t'
>>>> make[4]: *** [fw_printenv] Error 1
>>>> make[4]: Leaving directory `/space/build-trunk/trunk/build_dir/target-mips_r2_musl-0.9.8/uboot-envtools-2012.04.01'
>>>
>>> Where is loff_t being used? It's probably the wrong type to use. The
>>> only APIs loff_t is to be used with are under _GNU_SOURCE, so if you
>>> don't need -D_GNU_SOURCE to get the functions, it's doubtful that
>>> loff_t should be used. These functions are in fcntl.h, and it will
>>> #define loff_t off_t when _GNU_SOURCE is defined, so either
>>> -D_GNU_SOURCE or -Dloff_t=off_t would be a workaround, but I think the
>>> issue should be investigated to determine if there's code that needs
>>> to be fixed or if there are other circumstances under which loff_t
>>> should be exposed by musl.
>>>
>>> Rich
>>
>> It's used in
>> http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=tools/env/fw_env.c;h=37b60b80a7624566d9ecefdd04c0658134bd654d;hb=HEAD
>> where (you were absolutely right) a #include <fcntl.h> exists.
>> And -D_GNU_SOURCE helped. Thank you!
> 
> It looks like some ioctl interfaces also request loff_t in their
> official usage, so musl should do something to ensure it's exposed for
> ioctl. I'm not sure however what the best way is. Simply adding
> 
> #define loff_t off_t
> 
> to sys/ioctl.h is not sufficient because off_t might not be defined,
> so another header would need to be included to get off_t. Note that
> sys/ioctl.h is not under the domain of any modern standard, so it
> would not be a horrible offense to make it include extra junk if we
> need to..
> 
>> Happy about that, unfortunately there will come up much more things
>> I think, as seconds later the next undeclared error popped up..
> 
> OK, I'll take a look.
> 
>> (when compiling mtd
>> mips-openwrt-linux-musl-gcc -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -mno-branch-likely -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -Dtarget_ar71xx=1 -Wall -DFIS_SUPPORT=1  -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/include  -Wall   -c -o fis.o fis.c
>> fis.c: In function 'fis_open':
>> fis.c:80:64: error: 'MAP_LOCKED' undeclared (first use in this function)
>> fis.c:80:64: note: each undeclared identifier is reported only once for each function it appears in
>>
>> So I wonder why uClibc? seems to include these things. But there are
>> so many mman.h's and the one referenced from fis.c (sys/mman.h)
>> seems not to have the define, but otheres have.. . How could a
>> proper procedure look like to include these things, and on which
>> side of the code this should go is what I currently don't understand
>> at all. I just don't want to bother you if its bad behaviour of
>> Uclibc which enabled this things to work. But than propably an
>> generic workaround could be found.
> 
> MAP_LOCKED is a Linux extension to mmap that somehow never got added
> to musl when the others were added. Its definition probably varies
> per-arch. I'll see if I can get somebody to find what's needed to add
> it correctly for all archs.

You're right, unfortunately it varies.
http://lxr.free-electrons.com/ident?i=MAP_LOCKED


> 
> Rich



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

* Re: unknown type name 'loff_t'
  2013-01-24 18:55   ` Alexander Stadler
@ 2013-01-24 19:47     ` Szabolcs Nagy
  2013-01-25 10:10       ` MAP_LOCKED already added to mmap on current git version (was a sidenote on unknown type name 'loff_t' , which is an other "problem") Alexander Stadler
  0 siblings, 1 reply; 8+ messages in thread
From: Szabolcs Nagy @ 2013-01-24 19:47 UTC (permalink / raw)
  To: musl

* Alexander Stadler <sa.maillists@univie.ac.at> [2013-01-24 19:55:27 +0100]:
> mips-openwrt-linux-musl-gcc -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -mno-branch-likely -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -Dtarget_ar71xx=1 -Wall -DFIS_SUPPORT=1  -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/include  -Wall   -c -o fis.o fis.c
> fis.c: In function 'fis_open':
> fis.c:80:64: error: 'MAP_LOCKED' undeclared (first use in this function)
> fis.c:80:64: note: each undeclared identifier is reported only once for each function it appears in
> 

your musl is old, there were updates to mman.h recently

http://git.musl-libc.org/cgit/musl/commit/?id=7e0d4fce41ac95adc080bffa88ee0f51c1cf2837
http://git.musl-libc.org/cgit/musl/commit/?id=000806cde6416f51f783d2dc487d49b47d297e4e

there was no musl release since the updates
so that's why you are hitting these issues

(it's a good idea to check the git log in case of errors,
musl is still in development)


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

* Re: MAP_LOCKED already added to mmap on current git version (was a sidenote on unknown type name 'loff_t' , which is an other "problem")
  2013-01-24 19:47     ` Szabolcs Nagy
@ 2013-01-25 10:10       ` Alexander Stadler
  0 siblings, 0 replies; 8+ messages in thread
From: Alexander Stadler @ 2013-01-25 10:10 UTC (permalink / raw)
  To: musl

Am 24.01.2013 20:47, schrieb Szabolcs Nagy:
> * Alexander Stadler <sa.maillists@univie.ac.at> [2013-01-24 19:55:27 +0100]:
>> mips-openwrt-linux-musl-gcc -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -mno-branch-likely -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -Dtarget_ar71xx=1 -Wall -DFIS_SUPPORT=1  -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/target-mips_r2_musl-0.9.8/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/usr/include -I/space/build-trunk/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_musl-0.9.8/include  -Wall   -c -o fis.o fis.c
>> fis.c: In function 'fis_open':
>> fis.c:80:64: error: 'MAP_LOCKED' undeclared (first use in this function)
>> fis.c:80:64: note: each undeclared identifier is reported only once for each function it appears in
>>
> 
> your musl is old, there were updates to mman.h recently
> 
> http://git.musl-libc.org/cgit/musl/commit/?id=7e0d4fce41ac95adc080bffa88ee0f51c1cf2837
> http://git.musl-libc.org/cgit/musl/commit/?id=000806cde6416f51f783d2dc487d49b47d297e4e
> 
> there was no musl release since the updates
> so that's why you are hitting these issues
> 
> (it's a good idea to check the git log in case of errors,
> musl is still in development)

Thank you very much!
You were absolutely right, adding these commits (and http://git.musl-libc.org/cgit/musl/commit/?id=0e10f740069c2d805d3199a8079b73e828c7d8d9) added defines to mmap including MAP_LOCKED which mtd needed to compile. Didn't thought on checking git for that (as I didn't know that mmap is comming from there too).
So thank you Rich, seems as you don't have to find somebody to add them anymore ;-).

Also I have to say I'm getting really great support on your mailing list, thats very nice.

Alex


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

end of thread, other threads:[~2013-01-25 10:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-23 17:33 unknown type name 'loff_t' Alexander Stadler
2013-01-23 17:37 ` Rich Felker
2013-01-24 18:55   ` Alexander Stadler
2013-01-24 19:47     ` Szabolcs Nagy
2013-01-25 10:10       ` MAP_LOCKED already added to mmap on current git version (was a sidenote on unknown type name 'loff_t' , which is an other "problem") Alexander Stadler
2013-01-24 18:57   ` unknown type name 'loff_t' Alexander Stadler
2013-01-24 19:19     ` Rich Felker
2013-01-24 19:28       ` Alexander Stadler

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).