Re: Setting the default binary format

2010-11-26 Thread Anthony Green

On 11/26/2010 1:38 AM, Bernhard Reutner-Fischer wrote:

Hi,

Set default for your arch.
Cfg FOO
   Default cfg_BAZ if cfg_MOXA
See e.g. the commented out parts in threading selection.
See?


Thanks - that was it!

AG







On 25 Nov 2010 14:07, "Anthony Green" mailto:gr...@moxielogic.com>> wrote:

I've been working on a new port that I plan on submitting soon.

One thing that's tripping me up is the default binary format
selection.  My port only supports UCLIBC_FORMAT_FLAT.  I want all of
the config options selected correctly by default when I run..

make ARCH=moxie CROSS=moxie-elf- defconfig

So in my Config.moxie file I have a FORCE_OPTIONS_FOR_ARCH config
section that looks like this:

config FORCE_OPTIONS_FOR_ARCH
   bool
   default y
   select UCLIBC_FORMAT_FLAT
   select ARCH_BIG_ENDIAN
   select ARCH_HAS_NO_MMU
   select ARCH_HAS_NO_SHARED
   select ARCH_HAS_NO_LDSO
   select HAVE_NO_PIC
   select UCLIBC_SUSV3_LEGACY

But even with my UCLIBC_FORMAT_FLAT selection, the
UCLIBC_FORMAT_FDPIC_ELF option is always chosen for .config.   I have
to reorder things in Config.in.arch so that UCLIBC_FORMAT_FLAT
precedes UCLIBC_FORMAT_FDPIC_ELF in order to get the right choice.

How can I get the selection I want without making this change in
Config.in.arch (which, presumably, would affect other ports)?

Thanks!

AG
___
uClibc mailing list
uClibc@uclibc.org 
http://lists.busybox.net/mailman/listinfo/uclibc




___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: build fails on native x86_64 on utxent

2010-11-26 Thread Carmelo AMOROSO
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11/26/2010 9:22 AM, Carmelo Amoroso wrote:
> On 17/11/10 17:42, Carmelo AMOROSO wrote:
>  > On 11/17/2010 5:35 PM, Natanael Copa wrote:
>  >> On Tue, Nov 16, 2010 at 9:10 PM, Carmelo Amoroso  
> wrote:
>  >> > On 16/11/10 13:16, Natanael Copa wrote:
>  >> >> Hi,
>  >> >>
>  >> >> I'm trying to bootstrap a native uclibc x86_64 environment. Seems like
>  >> >> the recent utmpx commits breaks 64 bit.
>  >> >>
>  >> >> CC libc/misc/utmp/utxent.os
>  >> >> libc/misc/utmp/utxent.c: In function 'getutmp':
>  >> >> libc/misc/utmp/utxent.c:74:14: error: incompatible types when
>  >> >> assigning to type 'struct ' from type 'const struct
>  >> >> '
>  >> >> libc/misc/utmp/utxent.c: In function 'getutmpx':
>  >> >> libc/misc/utmp/utxent.c:100:15: error: incompatible types when
>  >> >> assigning to type 'struct ' from type 'const struct
>  >> >> '
>  >> >> make: *** [libc/misc/utmp/utxent.os] Error 1
>  >> >>
>  >> >>
>  >> >
>  >> >
>  >> > Hi Natanael,
>  >> > I'll have a look asap.
>  >> >
>  >> > Could you try disabling the support and see how it goes ?
>  >
>  >> Then it compiles successfully.
>  >
>  > Fine !
>  >
>  > Cheers,
>  > Carmelo
>  >
> 
> Natanael,
> I was able to reproduce on my 64bits host, working to fix.
> 
> carmelo
> 

Well,
I figured out where the problem and had a fix. I'm pretty sure that
glibc has the same issue.

Carmelo

>  >> --
>  >> Natanael Copa
>  >> ___
>  >> uClibc mailing list
>  >> uClibc@uclibc.org
>  >> http://lists.busybox.net/mailman/listinfo/uclibc
>  >
>  >
> ___
> uClibc mailing list
> uClibc@uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc
> 
> ___
> uClibc mailing list
> uClibc@uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzv1GQACgkQoRq/3BrK1s/nugCeP34aIMsSNOKunJTNi6U37Md3
wKkAniuVmEjOqNy2Tm/QLfoXsD7UIDAP
=Y/G0
-END PGP SIGNATURE-
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


[PATCH] libc: fix strtoq

2010-11-26 Thread Natanael Copa
strtoq should always return a quad_t and be an alias of strtol on
64 bit and strtoll on 32 bit.

Signed-off-by: Natanael Copa 
---
 include/stdlib.h |2 +-
 libc/stdlib/stdlib.c |3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/include/stdlib.h b/include/stdlib.h
index ce92ccd..300edf0 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -214,7 +214,7 @@ __END_NAMESPACE_STD
 
 /* Convert a string to a quadword integer.  */
 __extension__
-extern long long int strtoq (__const char *__restrict __nptr,
+extern quad_t strtoq (__const char *__restrict __nptr,
 char **__restrict __endptr, int __base)
  __THROW __nonnull ((1)) __wur;
 /* Convert a string to an unsigned quadword integer.  */
diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c
index ad0c4aa..4d608ee 100644
--- a/libc/stdlib/stdlib.c
+++ b/libc/stdlib/stdlib.c
@@ -342,6 +342,9 @@ extern __typeof(__XL_NPP(strtol)) __XL_NPP(strtoll);
 libc_hidden_proto(__XL_NPP(strtoll))
 strong_alias(__XL_NPP(strtol),__XL_NPP(strtoll))
 libc_hidden_def(__XL_NPP(strtoll))
+#if !defined(L_strtol_l)
+strong_alias(strtol,strtoq)
+#endif
 #endif
 
 #endif
-- 
1.7.3.2

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


strtoq on x86_64

2010-11-26 Thread Natanael Copa
Hi,

We are working on porting Alpine Linux to x86_64 (with nptl). In
addition to __GI___chk_fail fix[1] and protected symbols
"workaround"[2] we have so far bumped into an issue with strtoq. pcre
fails to build during linking on missing symbol strtoq. The configure
script only did a compile check when testing for strtoq() and not link
test. Changing[3] the configure script to do link test makes it build
successfully.

Second issue is asterisk, which also seems to be related to strtoq.

   [CC] chan_sip.c -> chan_sip.o
In file included from
/home/ncopa/aports/main/asterisk/src/asterisk-1.8.0/include/asterisk.h:27:0,
 from chan_sip.c:209:
/home/ncopa/aports/main/asterisk/src/asterisk-1.8.0/include/asterisk/compat.h:129:10:
error: conflicting types for 'strtoq'
/usr/include/stdlib.h:211:22: note: previous declaration of 'strtoq' was here
make[1]: *** [chan_sip.o] Error 1
make: *** [channels] Error 2

strtoq seems to be a strong alias to strtoll

This testcase works on x86 but not x86_64:

$ cat strtoq.c
int main() { char* e; return strtoq("100", &e, 10); }
$ gcc strtoq.c
/tmp/ccEh3NhS.o: In function `main':
strtoq.c:(.text+0x30): undefined reference to `strtoq'
collect2: ld returned 1 exit status

Doing the same with strtoll works though.

There are some ifdefs in libc/stdlib.c[4] that prevents the strtoq
alias be made. Exactly why i dont know really, but i think we either
need to create a correct alias for x86_64 or remove the strtoq def in
the header file.

-- 
Natanael Copa

[1] https://bugs.busybox.net/show_bug.cgi?id=2713
[2] http://lists.uclibc.org/pipermail/uclibc/2010-April/043935.html
[3] http://git.alpinelinux.org/cgit/aports/tree/main/pcre/uclibc-strtoq.patch
[4] http://git.uclibc.org/uClibc/tree/libc/stdlib/stdlib.c#n348
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: build fails on native x86_64 on utxent

2010-11-26 Thread Carmelo Amoroso
On 17/11/10 17:42, Carmelo AMOROSO wrote:
> On 11/17/2010 5:35 PM, Natanael Copa wrote:
>> On Tue, Nov 16, 2010 at 9:10 PM, Carmelo Amoroso  wrote:
>>  > On 16/11/10 13:16, Natanael Copa wrote:
>>  >> Hi,
>>  >>
>>  >> I'm trying to bootstrap a native uclibc x86_64 environment. Seems like
>>  >> the recent utmpx commits breaks 64 bit.
>>  >>
>>  >>   CC libc/misc/utmp/utxent.os
>>  >> libc/misc/utmp/utxent.c: In function 'getutmp':
>>  >> libc/misc/utmp/utxent.c:74:14: error: incompatible types when
>>  >> assigning to type 'struct ' from type 'const struct
>>  >> '
>>  >> libc/misc/utmp/utxent.c: In function 'getutmpx':
>>  >> libc/misc/utmp/utxent.c:100:15: error: incompatible types when
>>  >> assigning to type 'struct ' from type 'const struct
>>  >> '
>>  >> make: *** [libc/misc/utmp/utxent.os] Error 1
>>  >>
>>  >>
>>  >
>>  >
>>  > Hi Natanael,
>>  > I'll have a look asap.
>>  >
>>  > Could you try disabling the support and see how it goes ?
> 
>> Then it compiles successfully.
> 
> Fine !
> 
> Cheers,
> Carmelo
> 

Natanael,
I was able to reproduce on my 64bits host, working to fix.

carmelo

>> --
>> Natanael Copa
>> ___
>> uClibc mailing list
>> uClibc@uclibc.org
>> http://lists.busybox.net/mailman/listinfo/uclibc
> 
> 
___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc