public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0 of 5] Several patches for OSX,uClibc,gdb-6.8
@ 2011-08-21 13:13 Titus von Boxberg
  2011-08-21 13:13 ` [PATCH 1 of 5] configure: correct check_for Titus von Boxberg
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Titus von Boxberg @ 2011-08-21 13:13 UTC (permalink / raw)
  To: crossgcc; +Cc: yann.morin.1998

Yann, all,

this patch series corrects various bugs when building on OSX.
It cares about the bugs recently reported by Guylhem Aznar
and Pierrick Brossin building cloog/ppl, uClibc (0.9.30), and gdb (6.8).

Regards
Titus

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

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

* [PATCH 1 of 5] configure: correct check_for
  2011-08-21 13:13 [PATCH 0 of 5] Several patches for OSX,uClibc,gdb-6.8 Titus von Boxberg
@ 2011-08-21 13:13 ` Titus von Boxberg
  2011-08-21 13:14 ` [PATCH 2 of 5] main: need path to libtoolize Titus von Boxberg
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Titus von Boxberg @ 2011-08-21 13:13 UTC (permalink / raw)
  To: crossgcc; +Cc: yann.morin.1998

# HG changeset patch
# User Titus von Boxberg <titus@v9g.de>
# Date 1313876746 -7200
# Node ID a946359cb4429037976e6ff22c51515401eaf820
# Parent  41bd6777fa4f767d6264db7c58986920014fd708
configure: correct check_for

check_for didn't set variable 'where' when the path to a prog
was passed manually "(cached)".

Signed-off-by: "Titus von Boxberg" titus@v9g.de

diff -r 41bd6777fa4f -r a946359cb442 configure
--- a/configure	Wed Aug 17 23:53:49 2011 +0200
+++ b/configure	Sat Aug 20 23:45:46 2011 +0200
@@ -171,6 +171,7 @@
                 eval val="\${${var}}"
                 if [ -n "${val}" ]; then
                     status="${val} (cached)\n"
+                    where="${val}"
                     break
                 fi
             fi

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

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

* [PATCH 4 of 5] docs/Using on MacOS: Document usage with Xcode 4.1
  2011-08-21 13:13 [PATCH 0 of 5] Several patches for OSX,uClibc,gdb-6.8 Titus von Boxberg
                   ` (2 preceding siblings ...)
  2011-08-21 13:14 ` [PATCH 3 of 5] patches/uClibc-0.9.30: install_headers build step portable to OSX 10.7 Titus von Boxberg
@ 2011-08-21 13:14 ` Titus von Boxberg
  2011-08-21 13:21 ` [PATCH 5 of 5] patches/gdb/6.8: correct compilation error when stpcpy is a define Titus von Boxberg
  2011-08-21 22:22 ` [PATCH 0 of 5] Several patches for OSX,uClibc,gdb-6.8 Yann E. MORIN
  5 siblings, 0 replies; 8+ messages in thread
From: Titus von Boxberg @ 2011-08-21 13:14 UTC (permalink / raw)
  To: crossgcc; +Cc: yann.morin.1998

# HG changeset patch
# User Titus von Boxberg <titus@v9g.de>
# Date 1313921619 -7200
# Node ID d23cf8712f52b626e3906f996b900107dc642e3d
# Parent  8107b0e85cd1764f64a3790b7f3e2a0e80a61933
docs/Using on MacOS: Document usage with Xcode 4.1

With Xcode 4.1 'gcc' is symlinked llvm-gcc-4.2 which cannot bootstrap
other gccs.
See http://llvm.org/bugs/show_bug.cgi?id=9571

On my machine the faulty gcc is
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)

Document a workaround.

Signed-off-by: "Titus von Boxberg" <titus@v9g.de>

diff -r 8107b0e85cd1 -r d23cf8712f52 docs/C - Misc. tutorials.txt
--- a/docs/C - Misc. tutorials.txt	Sun Aug 21 10:19:36 2011 +0200
+++ b/docs/C - Misc. tutorials.txt	Sun Aug 21 12:13:39 2011 +0200
@@ -55,7 +55,7 @@
    mount somewhere.
 
 2) Install macports (or similar easy means of installing 3rd party software),
-   make sure that macport's bin dir is in your PATH.
+   make sure that macport's bin dir is in the front (!) of your PATH.
    Furtheron assuming it is /opt/local/bin.
 
 3) Install (at least) the following macports
@@ -65,11 +65,25 @@
    gsed
    gawk
    gcc43 (only necessary for Leopard OSX 10.5)
+   gcc_select (only necessary for OSX 10.5, or Xcode > 4)
 
+4) Prerequisites
    On Leopard, make sure that the macport's gcc is called with the default
-   commands (gcc, g++,...), e.g. via macport gcc_select
+   commands (gcc, g++,...), via macport's gcc_select
 
-4) run ct-ng's configure with the following tool configuration
+   On OSX 10.7 Lion / when using Xcode >= 4 make sure that the default commands
+   (gcc, g++, etc.) point to gcc-4.2, NOT llvm-gcc-4.2
+   by using macport's gcc_select feature. With MacPorts >= 1.9.2
+   the command is: "sudo port select --set gcc gcc42"
+   This also requires (like written above) that macport's bin dir
+   comes before standard directories in your PATH environment variable
+   because the gcc symlink is installed in /opt/local/bin and the default /usr/bin/gcc
+   is not removed by the gcc select command!
+   Explanation: llvm-gcc-4.2 (with Xcode 4.1 it is on my machine
+   "gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)")
+   cannot boostrap gcc. See http://llvm.org/bugs/show_bug.cgi?id=9571
+
+5) run ct-ng's configure with the following tool configuration
    (assuming you have installed the tools via macports in /opt/local):
    ./configure --with-sed=/opt/local/bin/gsed                 \
                --with-libtool=/opt/local/bin/glibtool         \
@@ -79,7 +93,7 @@
                --with-readelf=/opt/local/bin/greadelf         \
                [...other configure parameters as you like...]
 
-5) proceed as described in standard documentation
+6) proceed as described in standard documentation
 
 -----
 

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

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

* [PATCH 3 of 5] patches/uClibc-0.9.30: install_headers build step portable to OSX 10.7
  2011-08-21 13:13 [PATCH 0 of 5] Several patches for OSX,uClibc,gdb-6.8 Titus von Boxberg
  2011-08-21 13:13 ` [PATCH 1 of 5] configure: correct check_for Titus von Boxberg
  2011-08-21 13:14 ` [PATCH 2 of 5] main: need path to libtoolize Titus von Boxberg
@ 2011-08-21 13:14 ` Titus von Boxberg
  2011-08-21 13:14 ` [PATCH 4 of 5] docs/Using on MacOS: Document usage with Xcode 4.1 Titus von Boxberg
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Titus von Boxberg @ 2011-08-21 13:14 UTC (permalink / raw)
  To: crossgcc; +Cc: yann.morin.1998

# HG changeset patch
# User Titus von Boxberg <titus@v9g.de>
# Date 1313914776 -7200
# Node ID 8107b0e85cd1764f64a3790b7f3e2a0e80a61933
# Parent  bd9a1c22c37c77c6563311a6a7e816bef0855382
patches/uClibc-0.9.30: install_headers build step portable to OSX 10.7

Add patch files for uClibc-0.9.30:
extra/scripts/install_headers.sh: find must be called with path.
extra/scripts/unifdef.c: getline is declared in <stdio.h>, use different name.

Signed-off-by: "Titus von Boxberg" <titus@v9g.de>

diff -r bd9a1c22c37c -r 8107b0e85cd1 patches/uClibc/0.9.30/200-getline-already-declared.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/uClibc/0.9.30/200-getline-already-declared.patch	Sun Aug 21 10:19:36 2011 +0200
@@ -0,0 +1,29 @@
+--- uClibc-0.9.30.orig/extra/scripts/unifdef.c	2008-04-28 01:10:00.000000000 +0200
++++ uClibc-0.9.30/extra/scripts/unifdef.c	2011-08-21 09:42:21.000000000 +0200
+@@ -206,7 +206,7 @@
+ static void             error(const char *);
+ static int              findsym(const char *);
+ static void             flushline(bool);
+-static Linetype         getline(void);
++static Linetype         getlinetype(void);
+ static Linetype         ifeval(const char **);
+ static void             ignoreoff(void);
+ static void             ignoreon(void);
+@@ -512,7 +512,7 @@
+ 
+ 	for (;;) {
+ 		linenum++;
+-		lineval = getline();
++		lineval = getlinetype();
+ 		trans_table[ifstate[depth]][lineval]();
+ 		debug("process %s -> %s depth %d",
+ 		    linetype_name[lineval],
+@@ -526,7 +526,7 @@
+  * help from skipcomment().
+  */
+ static Linetype
+-getline(void)
++getlinetype(void)
+ {
+ 	const char *cp;
+ 	int cursym;
diff -r bd9a1c22c37c -r 8107b0e85cd1 patches/uClibc/0.9.30/210-find-portable.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/uClibc/0.9.30/210-find-portable.patch	Sun Aug 21 10:19:36 2011 +0200
@@ -0,0 +1,11 @@
+--- uClibc-0.9.30.orig/extra/scripts/install_headers.sh	2008-10-10 15:50:38.000000000 +0200
++++ uClibc-0.9.30/extra/scripts/install_headers.sh	2011-08-21 09:49:03.000000000 +0200
+@@ -33,7 +33,7 @@
+ (
+ # We must cd, or else we'll prepend "$1" to filenames!
+ cd "$1" || exit 1
+-find ! -name '.' -a ! -path '*/.*' | sed -e 's/^\.\///' -e '/^config\//d' \
++find . ! -name '.' -a ! -path '*/.*' | sed -e 's/^\.\///' -e '/^config\//d' \
+ 	-e '/^config$/d'
+ ) | \
+ (

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

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

* [PATCH 2 of 5] main: need path to libtoolize
  2011-08-21 13:13 [PATCH 0 of 5] Several patches for OSX,uClibc,gdb-6.8 Titus von Boxberg
  2011-08-21 13:13 ` [PATCH 1 of 5] configure: correct check_for Titus von Boxberg
@ 2011-08-21 13:14 ` Titus von Boxberg
  2011-08-21 13:14 ` [PATCH 3 of 5] patches/uClibc-0.9.30: install_headers build step portable to OSX 10.7 Titus von Boxberg
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Titus von Boxberg @ 2011-08-21 13:14 UTC (permalink / raw)
  To: crossgcc; +Cc: yann.morin.1998

# HG changeset patch
# User Titus von Boxberg <titus@v9g.de>
# Date 1313914387 -7200
# Node ID bd9a1c22c37c77c6563311a6a7e816bef0855382
# Parent  a946359cb4429037976e6ff22c51515401eaf820
main: need path to libtoolize

libtoolize must be checked_for and there needs to be a wrapper
that points to GNU libtoolize since that may be installed
as glibtoolize.

Signed-off-by: "Titus von Boxberg" <titus@v9g.de>

diff -r a946359cb442 -r bd9a1c22c37c Makefile.in
--- a/Makefile.in	Sat Aug 20 23:45:46 2011 +0200
+++ b/Makefile.in	Sun Aug 21 10:13:07 2011 +0200
@@ -47,16 +47,17 @@
 LOCAL  := @@LOCAL@@
 
 # Paths found by ./configure
-install:= @@install@@
-bash   := @@bash@@
-grep   := @@grep@@
-make   := @@make@@
-sed    := @@sed@@
-libtool:= @@libtool@@
-objcopy:= @@objcopy@@
-objdump:= @@objdump@@
-readelf:= @@readelf@@
-patch  := @@patch@@
+install   := @@install@@
+bash      := @@bash@@
+grep      := @@grep@@
+make      := @@make@@
+sed       := @@sed@@
+libtool   := @@libtool@@
+libtoolize:= @@libtoolize@@
+objcopy   := @@objcopy@@
+objdump   := @@objdump@@
+readelf   := @@readelf@@
+patch     := @@patch@@
 
 # config options to push down to kconfig
 KCONFIG:= @@KCONFIG@@
@@ -164,6 +165,7 @@
 	  echo "export make=$(make)";       \
 	  echo "export sed=$(sed)";         \
 	  echo "export libtool=$(libtool)"; \
+	  echo "export libtoolize=$(libtoolize)"; \
 	  echo "export objcopy=$(objcopy)"; \
 	  echo "export objdump=$(objdump)"; \
 	  echo "export readelf=$(readelf)"; \
diff -r a946359cb442 -r bd9a1c22c37c configure
--- a/configure	Sat Aug 20 23:45:46 2011 +0200
+++ b/configure	Sun Aug 21 10:13:07 2011 +0200
@@ -448,6 +448,10 @@
              var=libtool                                                                            \
              ver='\(GNU libtool.*\) (2[[:digit:]]*\.|1\.6[[:digit:]]*\.|1\.5\.[2-9][[:digit:]]+)'   \
              err="'libtool' 1.5.26 or above was not found"
+has_or_abort prog=libtoolize                                                                        \
+             var=libtoolize                                                                         \
+             ver='\(GNU libtool.*\) (2[[:digit:]]*\.|1\.6[[:digit:]]*\.|1\.5\.[2-9][[:digit:]]+)'   \
+             err="'libtoolize' 1.5.26 or above was not found"
 has_or_abort prog=stat
 has_or_abort prog="curl wget"
 has_or_abort prog=patch
diff -r a946359cb442 -r bd9a1c22c37c docs/C - Misc. tutorials.txt
--- a/docs/C - Misc. tutorials.txt	Sat Aug 20 23:45:46 2011 +0200
+++ b/docs/C - Misc. tutorials.txt	Sun Aug 21 10:13:07 2011 +0200
@@ -71,11 +71,12 @@
 
 4) run ct-ng's configure with the following tool configuration
    (assuming you have installed the tools via macports in /opt/local):
-   ./configure --with-sed=/opt/local/bin/gsed           \
-               --with-libtool=/opt/local/bin/glibtool   \
-               --with-objcopy=/opt/local/bin/gobjcopy   \
-               --with-objdump=/opt/local/bin/gobjdump   \
-               --with-readelf=/opt/local/bin/greadelf   \
+   ./configure --with-sed=/opt/local/bin/gsed                 \
+               --with-libtool=/opt/local/bin/glibtool         \
+               --with-libtoolize=/opt/local/bin/glibtoolize   \
+               --with-objcopy=/opt/local/bin/gobjcopy         \
+               --with-objdump=/opt/local/bin/gobjdump         \
+               --with-readelf=/opt/local/bin/greadelf         \
                [...other configure parameters as you like...]
 
 5) proceed as described in standard documentation

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

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

* [PATCH 5 of 5] patches/gdb/6.8: correct compilation error when stpcpy is a define
  2011-08-21 13:13 [PATCH 0 of 5] Several patches for OSX,uClibc,gdb-6.8 Titus von Boxberg
                   ` (3 preceding siblings ...)
  2011-08-21 13:14 ` [PATCH 4 of 5] docs/Using on MacOS: Document usage with Xcode 4.1 Titus von Boxberg
@ 2011-08-21 13:21 ` Titus von Boxberg
  2011-08-21 22:22 ` [PATCH 0 of 5] Several patches for OSX,uClibc,gdb-6.8 Yann E. MORIN
  5 siblings, 0 replies; 8+ messages in thread
From: Titus von Boxberg @ 2011-08-21 13:21 UTC (permalink / raw)
  To: crossgcc; +Cc: yann.morin.1998

# HG changeset patch
# User Titus von Boxberg <titus@v9g.de>
# Date 1313926918 -7200
# Node ID b595540e1ff53f9336473755633a44e5c49c73c0
# Parent  d23cf8712f52b626e3906f996b900107dc642e3d
patches/gdb/6.8: correct compilation error when stpcpy is a define

On OSX stpcpy is a define which is not recognized by gdb's configure.
This results in a compilation error.

Signed-off-by: "Titus von Boxberg" <titus@v9g.de>

diff -r d23cf8712f52 -r b595540e1ff5 patches/gdb/6.8/150-handle-stpcpy-define.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/gdb/6.8/150-handle-stpcpy-define.patch	Sun Aug 21 13:41:58 2011 +0200
@@ -0,0 +1,12 @@
+diff -ru gdb-6.8.orig/bfd/sysdep.h gdb-6.8/bfd/sysdep.h
+--- gdb-6.8.orig/bfd/sysdep.h	2007-07-03 16:26:42.000000000 +0200
++++ gdb-6.8/bfd/sysdep.h	2011-08-21 13:33:47.000000000 +0200
+@@ -131,7 +131,7 @@
+ extern PTR realloc ();
+ #endif
+ 
+-#if !HAVE_DECL_STPCPY
++#if !HAVE_DECL_STPCPY && !defined(stpcpy)
+ extern char *stpcpy (char *__dest, const char *__src);
+ #endif
+ 

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

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

* Re: [PATCH 0 of 5] Several patches for OSX,uClibc,gdb-6.8
  2011-08-21 13:13 [PATCH 0 of 5] Several patches for OSX,uClibc,gdb-6.8 Titus von Boxberg
                   ` (4 preceding siblings ...)
  2011-08-21 13:21 ` [PATCH 5 of 5] patches/gdb/6.8: correct compilation error when stpcpy is a define Titus von Boxberg
@ 2011-08-21 22:22 ` Yann E. MORIN
  2011-08-21 22:53   ` Yann E. MORIN
  5 siblings, 1 reply; 8+ messages in thread
From: Yann E. MORIN @ 2011-08-21 22:22 UTC (permalink / raw)
  To: crossgcc; +Cc: Titus von Boxberg

On Sunday 21 August 2011 15:09:00 Titus von Boxberg wrote:
> Yann, all,
> 
> this patch series corrects various bugs when building on OSX.

Looks good.

> It cares about the bugs recently reported by Guylhem Aznar
> and Pierrick Brossin building cloog/ppl, uClibc (0.9.30), and gdb (6.8).

Care to resubmit, adding Reported-by: tags as appropriate, please?

The order is:
  Reported-by: John Doe <john@doe.net>
  Tested-by: "Random J. Tester" <r.j@tester.net>
  Signed-off-by: Jane Doe <jane@doe.net>

If multiple reporters, try listing first reporter firts. If possible,
it is not really important; what is important is that people get credited
for the job they did. And reporters are important too. ;-)

Thank you!

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

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

* Re: [PATCH 0 of 5] Several patches for OSX,uClibc,gdb-6.8
  2011-08-21 22:22 ` [PATCH 0 of 5] Several patches for OSX,uClibc,gdb-6.8 Yann E. MORIN
@ 2011-08-21 22:53   ` Yann E. MORIN
  0 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2011-08-21 22:53 UTC (permalink / raw)
  To: crossgcc; +Cc: Titus von Boxberg

Titus, All,

On Monday 22 August 2011 00:21:58 Yann E. MORIN wrote:
> On Sunday 21 August 2011 15:09:00 Titus von Boxberg wrote:
> > Yann, all,
> > 
> > this patch series corrects various bugs when building on OSX.
> 
> Looks good.

Also, could you recategorise the changesets:

patch 1/5:   configure: fix --with-prog=[...]
patch 2/5:   configure: require libtoolise, create wrapper
patch 3/5:   libc/uClibc: portability fixes to install_headers
patch 4/5:   docs: document usage with Xcode 4.1
patch 5/5:   debug/gdb: correct compilation error when stpcpy is a define

The global rule is:

 - when changing a component, the prefix is: categroy/component
   for example:
      kernel/linux: add blabla
      arch/arm: do foo bar
      debug/gdb: buzify the bazel
      libc/uClibc: check the stuff
      complibs/ppl: do that foolish stuff again

 - when changing configure (and the correspondiong stuff in Makefile.in)
   the prefix is simply: configure
   for example:
      configure: fix blabla, require foobar

 - when changing stuff in kconfig, the prefix should be: kconfig
   optionally, the frontend can be specified. eg.:
      kconfig: fix bla bla
      kconfig/mconf: show bar buz
      kconfig/nconf: hide bar buz

 - other prefixes could be:
      config   : for changes to the infrastructure in the config/ dir
      scripts  : for changes to the infrastructure in the scripts/ dir
      samples  : for changes in the samples/ dir
      docs     : for changes to the documentation

Deviations to the rule can apply, of course, but that should be the exception
rather than the rule.

No, this is not documented, I'll do it soon (probably tomorrow).

Thanks again for looking into that! :-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

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

end of thread, other threads:[~2011-08-21 22:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-21 13:13 [PATCH 0 of 5] Several patches for OSX,uClibc,gdb-6.8 Titus von Boxberg
2011-08-21 13:13 ` [PATCH 1 of 5] configure: correct check_for Titus von Boxberg
2011-08-21 13:14 ` [PATCH 2 of 5] main: need path to libtoolize Titus von Boxberg
2011-08-21 13:14 ` [PATCH 3 of 5] patches/uClibc-0.9.30: install_headers build step portable to OSX 10.7 Titus von Boxberg
2011-08-21 13:14 ` [PATCH 4 of 5] docs/Using on MacOS: Document usage with Xcode 4.1 Titus von Boxberg
2011-08-21 13:21 ` [PATCH 5 of 5] patches/gdb/6.8: correct compilation error when stpcpy is a define Titus von Boxberg
2011-08-21 22:22 ` [PATCH 0 of 5] Several patches for OSX,uClibc,gdb-6.8 Yann E. MORIN
2011-08-21 22:53   ` Yann E. MORIN

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