public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] uClibc: fix darwin build
@ 2014-10-25 15:29 Andreas Bießmann
  2014-12-06 17:10 ` Andreas Bießmann
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Bießmann @ 2014-10-25 15:29 UTC (permalink / raw)
  To: crossgcc; +Cc: Andreas Bießmann, Yann E. MORIN

uClibc's unifdef tool declares strlcpy(3) which is problematic on OS X. There
(and probably on other systems) strlcpy(3) is defined as a macro, re-declaring
it here will fail cause the macro expansion will generate an invalid function
name.
The declaration of strlcpy(3) is however useless cause it is never used in the
tool. Also upstream patch 2a021ae81c36f4281883a3195f7ce81504edf978 will remove
it. Using that patch here is overkill, cause it rewrites a lot of the
unifdef.c code.

Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
---
 patches/uClibc/0.9.33.2/300-fix-darwin-build.patch | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 patches/uClibc/0.9.33.2/300-fix-darwin-build.patch

diff --git a/patches/uClibc/0.9.33.2/300-fix-darwin-build.patch b/patches/uClibc/0.9.33.2/300-fix-darwin-build.patch
new file mode 100644
index 0000000..884307d
--- /dev/null
+++ b/patches/uClibc/0.9.33.2/300-fix-darwin-build.patch
@@ -0,0 +1,12 @@
+diff -Nrupa uClibc-0.9.33.2.orig/extra/scripts/unifdef.c uClibc-0.9.33.2/extra/scripts/unifdef.c
+--- uClibc-0.9.33.2.orig/extra/scripts/unifdef.c	2012-05-15 09:20:09.000000000 +0200
++++ uClibc-0.9.33.2/extra/scripts/unifdef.c	2014-10-25 17:07:33.000000000 +0200
+@@ -78,8 +78,6 @@ __FBSDID("$FreeBSD: /repoman/r/ncvs/src/
+ #define errx(exit_code, fmt, args...) ({ warnx(fmt, ## args); exit(exit_code); })
+ #define err(exit_code, fmt, args...)  errx(exit_code, fmt ": %s", ## args, strerror(errno))
+ 
+-size_t strlcpy(char *dst, const char *src, size_t siz);
+-
+ /* types of input lines: */
+ typedef enum {
+ 	LT_TRUEI,		/* a true #if with ignore flag */
-- 
1.9.3 (Apple Git-50)


--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* Re: [PATCH] uClibc: fix darwin build
  2014-10-25 15:29 [PATCH] uClibc: fix darwin build Andreas Bießmann
@ 2014-12-06 17:10 ` Andreas Bießmann
  2014-12-07  5:21   ` Bryan Hundven
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Bießmann @ 2014-12-06 17:10 UTC (permalink / raw)
  To: crossgcc


[-- Attachment #1.1: Type: text/plain, Size: 1848 bytes --]

Please review me

On 25.10.14 17:29, Andreas Bießmann wrote:
> uClibc's unifdef tool declares strlcpy(3) which is problematic on OS X. There
> (and probably on other systems) strlcpy(3) is defined as a macro, re-declaring
> it here will fail cause the macro expansion will generate an invalid function
> name.
> The declaration of strlcpy(3) is however useless cause it is never used in the
> tool. Also upstream patch 2a021ae81c36f4281883a3195f7ce81504edf978 will remove
> it. Using that patch here is overkill, cause it rewrites a lot of the
> unifdef.c code.
> 
> Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
> Cc: Yann E. MORIN <yann.morin.1998@free.fr>
> ---
>  patches/uClibc/0.9.33.2/300-fix-darwin-build.patch | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>  create mode 100644 patches/uClibc/0.9.33.2/300-fix-darwin-build.patch
> 
> diff --git a/patches/uClibc/0.9.33.2/300-fix-darwin-build.patch b/patches/uClibc/0.9.33.2/300-fix-darwin-build.patch
> new file mode 100644
> index 0000000..884307d
> --- /dev/null
> +++ b/patches/uClibc/0.9.33.2/300-fix-darwin-build.patch
> @@ -0,0 +1,12 @@
> +diff -Nrupa uClibc-0.9.33.2.orig/extra/scripts/unifdef.c uClibc-0.9.33.2/extra/scripts/unifdef.c
> +--- uClibc-0.9.33.2.orig/extra/scripts/unifdef.c	2012-05-15 09:20:09.000000000 +0200
> ++++ uClibc-0.9.33.2/extra/scripts/unifdef.c	2014-10-25 17:07:33.000000000 +0200
> +@@ -78,8 +78,6 @@ __FBSDID("$FreeBSD: /repoman/r/ncvs/src/
> + #define errx(exit_code, fmt, args...) ({ warnx(fmt, ## args); exit(exit_code); })
> + #define err(exit_code, fmt, args...)  errx(exit_code, fmt ": %s", ## args, strerror(errno))
> + 
> +-size_t strlcpy(char *dst, const char *src, size_t siz);
> +-
> + /* types of input lines: */
> + typedef enum {
> + 	LT_TRUEI,		/* a true #if with ignore flag */
> 

[-- Attachment #1.2: 0xBC2469C7.asc --]
[-- Type: application/pgp-keys, Size: 36948 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] uClibc: fix darwin build
  2014-12-06 17:10 ` Andreas Bießmann
@ 2014-12-07  5:21   ` Bryan Hundven
  2014-12-07  9:45     ` Andreas Bießmann
  0 siblings, 1 reply; 4+ messages in thread
From: Bryan Hundven @ 2014-12-07  5:21 UTC (permalink / raw)
  To: Andreas Bießmann; +Cc: crossgcc maillist

Andreas,

On Sat, Dec 6, 2014 at 9:10 AM, Andreas Bießmann <andreas@biessmann.de> wrote:
> Please review me
>
> On 25.10.14 17:29, Andreas Bießmann wrote:
>> uClibc's unifdef tool declares strlcpy(3) which is problematic on OS X. There
>> (and probably on other systems) strlcpy(3) is defined as a macro, re-declaring
>> it here will fail cause the macro expansion will generate an invalid function
>> name.
>> The declaration of strlcpy(3) is however useless cause it is never used in the
>> tool. Also upstream patch 2a021ae81c36f4281883a3195f7ce81504edf978 will remove
>> it. Using that patch here is overkill, cause it rewrites a lot of the
>> unifdef.c code.
>>
>> Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
>> Cc: Yann E. MORIN <yann.morin.1998@free.fr>
>> ---
>>  patches/uClibc/0.9.33.2/300-fix-darwin-build.patch | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>  create mode 100644 patches/uClibc/0.9.33.2/300-fix-darwin-build.patch
>>
>> diff --git a/patches/uClibc/0.9.33.2/300-fix-darwin-build.patch b/patches/uClibc/0.9.33.2/300-fix-darwin-build.patch
>> new file mode 100644
>> index 0000000..884307d
>> --- /dev/null
>> +++ b/patches/uClibc/0.9.33.2/300-fix-darwin-build.patch
>> @@ -0,0 +1,12 @@
>> +diff -Nrupa uClibc-0.9.33.2.orig/extra/scripts/unifdef.c uClibc-0.9.33.2/extra/scripts/unifdef.c
>> +--- uClibc-0.9.33.2.orig/extra/scripts/unifdef.c     2012-05-15 09:20:09.000000000 +0200
>> ++++ uClibc-0.9.33.2/extra/scripts/unifdef.c  2014-10-25 17:07:33.000000000 +0200
>> +@@ -78,8 +78,6 @@ __FBSDID("$FreeBSD: /repoman/r/ncvs/src/
>> + #define errx(exit_code, fmt, args...) ({ warnx(fmt, ## args); exit(exit_code); })
>> + #define err(exit_code, fmt, args...)  errx(exit_code, fmt ": %s", ## args, strerror(errno))
>> +
>> +-size_t strlcpy(char *dst, const char *src, size_t siz);
>> +-
>> + /* types of input lines: */
>> + typedef enum {
>> +     LT_TRUEI,               /* a true #if with ignore flag */
>>

Have you tried to get this patch upstream in uclibc?

-Bryan

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* Re: [PATCH] uClibc: fix darwin build
  2014-12-07  5:21   ` Bryan Hundven
@ 2014-12-07  9:45     ` Andreas Bießmann
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Bießmann @ 2014-12-07  9:45 UTC (permalink / raw)
  To: Bryan Hundven; +Cc: crossgcc maillist


[-- Attachment #1.1: Type: text/plain, Size: 2600 bytes --]

Dear Bryan,

On 07.12.14 06:20, Bryan Hundven wrote:
> Andreas,
> 
> On Sat, Dec 6, 2014 at 9:10 AM, Andreas Bießmann <andreas@biessmann.de> wrote:
>> Please review me
>>
>> On 25.10.14 17:29, Andreas Bießmann wrote:
>>> uClibc's unifdef tool declares strlcpy(3) which is problematic on OS X. There
>>> (and probably on other systems) strlcpy(3) is defined as a macro, re-declaring
>>> it here will fail cause the macro expansion will generate an invalid function
>>> name.
>>> The declaration of strlcpy(3) is however useless cause it is never used in the
>>> tool. Also upstream patch 2a021ae81c36f4281883a3195f7ce81504edf978 will remove
>>> it. Using that patch here is overkill, cause it rewrites a lot of the
>>> unifdef.c code.
>>>
>>> Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
>>> Cc: Yann E. MORIN <yann.morin.1998@free.fr>
>>> ---
>>>  patches/uClibc/0.9.33.2/300-fix-darwin-build.patch | 12 ++++++++++++
>>>  1 file changed, 12 insertions(+)
>>>  create mode 100644 patches/uClibc/0.9.33.2/300-fix-darwin-build.patch
>>>
>>> diff --git a/patches/uClibc/0.9.33.2/300-fix-darwin-build.patch b/patches/uClibc/0.9.33.2/300-fix-darwin-build.patch
>>> new file mode 100644
>>> index 0000000..884307d
>>> --- /dev/null
>>> +++ b/patches/uClibc/0.9.33.2/300-fix-darwin-build.patch
>>> @@ -0,0 +1,12 @@
>>> +diff -Nrupa uClibc-0.9.33.2.orig/extra/scripts/unifdef.c uClibc-0.9.33.2/extra/scripts/unifdef.c
>>> +--- uClibc-0.9.33.2.orig/extra/scripts/unifdef.c     2012-05-15 09:20:09.000000000 +0200
>>> ++++ uClibc-0.9.33.2/extra/scripts/unifdef.c  2014-10-25 17:07:33.000000000 +0200
>>> +@@ -78,8 +78,6 @@ __FBSDID("$FreeBSD: /repoman/r/ncvs/src/
>>> + #define errx(exit_code, fmt, args...) ({ warnx(fmt, ## args); exit(exit_code); })
>>> + #define err(exit_code, fmt, args...)  errx(exit_code, fmt ": %s", ## args, strerror(errno))
>>> +
>>> +-size_t strlcpy(char *dst, const char *src, size_t siz);
>>> +-
>>> + /* types of input lines: */
>>> + typedef enum {
>>> +     LT_TRUEI,               /* a true #if with ignore flag */
>>>
> 
> Have you tried to get this patch upstream in uclibc?

as stated in commit message this change is part of
2a021ae81c36f4281883a3195f7ce81504edf978 upstream [1]. Unfortunately
that patch is way more intrusive, therefore I choose the remove of that
line in favour of adding all the changes
2a021ae81c36f4281883a3195f7ce81504edf978 introduces.

Best regards

Andreas Bießmann

[1]
http://git.uclibc.org/uClibc/diff/extra/scripts/unifdef.c?id=2a021ae81c36f4281883a3195f7ce81504edf978


[-- Attachment #1.2: 0xBC2469C7.asc --]
[-- Type: application/pgp-keys, Size: 36948 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2014-12-07  9:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-25 15:29 [PATCH] uClibc: fix darwin build Andreas Bießmann
2014-12-06 17:10 ` Andreas Bießmann
2014-12-07  5:21   ` Bryan Hundven
2014-12-07  9:45     ` Andreas Bießmann

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 read-only IMAP folder(s) and NNTP newsgroup(s).