Skip to contentSkip to conversation

Embedded Maintainer(s), linux-embedded@vger list

PATCH In review David Woodhouse 42 participants 204 messages Apr 30, 2008 – Jun 25, 2008 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

cover Embedded Maintainer(s), linux-embedded@vger list

Andrew Morton has been saying recently that we need an 'embedded maintainer', to take responsibility for 'embedded issues' in the core kernel, as well as trying to improve our relationship with those using the Linux kernel for 'embedded' devices -- who have a reputation of not working with us very closely; to their detriment as well as our own.

Various people, including myself, have been doing that kind of thing on and off over the years anyway, but Andrew is probably right that it's worth having someone listed in the MAINTAINERS file who actually considers it their responsibility, and as a point of contact for people seeking advice, review, etc.

I've volunteered to take a more active rôle in this, and Wind River has agreed to assign Paul Gortmaker to it, too. The following patch adds both of us to the MAINTAINERS file.

We have also set up a mailing list, [email protected], where development related to embedded stuff can happen in a slightly less noisy environment than the main linux-kernel list. We'd like to encourage anyone working on Linux in embedded devices to join the list.

Signature · 1 line
dwmw2
#1 lore raw

PATCH 1/1 Embedded Maintainer(s), linux-embedded@vger list

Add Paul and myself, and the linux-embedded list, to MAINTAINERS.

MAINTAINERS +8 -0
index bca09ed..3650ed1 100644
@@ -1550,6 +1550,14 @@ M:	[email protected]
 L:	[email protected]
 S:	Supported
 
+EMBEDDED LINUX
+P:	Paul Gortmaker
+M:	[email protected]
+P	David Woodhouse
+M:	[email protected]
+L:	[email protected]
+S:	Maintained
+
 EMULEX LPFC FC SCSI DRIVER
 P:	James Smart
 M:	[email protected]
Signature · 1 line
dwmw2
#5 lore raw
In reply to David Woodhouse
Quoted 6 lines · David Woodhouse

Andrew Morton has been saying recently that we need an 'embedded maintainer', to take responsibility for 'embedded issues' in the core kernel, as well as trying to improve our relationship with those using the Linux kernel for 'embedded' devices -- who have a reputation of not working with us very closely; to their detriment as well as our own.

I hope your job description doesn't include adding more and more CONFIGs though.

I am sure there are lots of low hanging fruit where memory can be saved and it's a good thing someone cares about that, but please don't focus on the code size only. Or if you work on that don't do it using CONFIG or when you really add a new one find some other that is pointless and remove it first.

There are simply already far too many of them and they make the kernel harder and harder to change.

-Andi

#201 lore raw
In reply to David Woodhouse
Quoted 13 lines · David Woodhouse

Andrew Morton has been saying recently that we need an 'embedded maintainer', to take responsibility for 'embedded issues' in the core kernel, as well as trying to improve our relationship with those using the Linux kernel for 'embedded' devices -- who have a reputation of not working with us very closely; to their detriment as well as our own.

Various people, including myself, have been doing that kind of thing on and off over the years anyway, but Andrew is probably right that it's worth having someone listed in the MAINTAINERS file who actually considers it their responsibility, and as a point of contact for people seeking advice, review, etc.

Quoted 3 lines

I've volunteered to take a more active rôle in this, and Wind River has agreed to assign Paul Gortmaker to it, too. The following patch adds both of us to the MAINTAINERS file.

Excellent news.

Quoted 4 lines

We have also set up a mailing list, [email protected], where development related to embedded stuff can happen in a slightly less noisy environment than the main linux-kernel list. We'd like to encourage anyone working on Linux in embedded devices to join the list.

Do you see this list as a general embedded patch/issues discussion list, a help list, a list for vendors to interact with the community, or all of the above?

I ask because having the entry in MAINTAINERS is great, but I expect some to be a bit confused as to what that actually means.

josh

#202 lore raw
Quoted 3 lines · Josh Boyer

Do you see this list as a general embedded patch/issues discussion list, a help list, a list for vendors to interact with the community, or all of the above?

All of the above -- although I dislike the phrase 'interact with the community'. I want vendors to be _part_ of the community, not outsiders who merely interact with it.

Signature · 1 line
dwmw2
#203 lore raw
Quoted 8 lines · David Woodhouse
Quoted 3 lines · Josh Boyer

Do you see this list as a general embedded patch/issues discussion list, a help list, a list for vendors to interact with the community, or all of the above?

All of the above -- although I dislike the phrase 'interact with the community'. I want vendors to be _part_ of the community, not outsiders who merely interact with it.

Sure, agreed. Have to start somewhere though.

josh

#6 lore raw
In reply to Andi Kleen
Quoted 12 lines · Andi Kleen
Quoted 6 lines · David Woodhouse

Andrew Morton has been saying recently that we need an 'embedded maintainer', to take responsibility for 'embedded issues' in the core kernel, as well as trying to improve our relationship with those using the Linux kernel for 'embedded' devices -- who have a reputation of not working with us very closely; to their detriment as well as our own.

I hope your job description doesn't include adding more and more CONFIGs though.

Quoted 8 lines

I am sure there are lots of low hanging fruit where memory can be saved and it's a good thing someone cares about that, but please don't focus on the code size only. Or if you work on that don't do it using CONFIG or when you really add a new one find some other that is pointless and remove it first.

There are simply already far too many of them and they make the kernel harder and harder to change.

I agree. And if we do want to pay attention to pure code size, there are other approaches -- like --gc-sections and/or building with '--combine -fwhole-program' which I was playing with for OLPC a while back. I must dust that off now that the GCC fixes should mostly have made it into current distributions.

Signature · 1 line
dwmw2
#204 lore raw
In reply to David Woodhouse
Quoted 7 lines · David Woodhouse

Andrew Morton has been saying recently that we need an 'embedded maintainer', to take responsibility for 'embedded issues' in the core kernel, as well as trying to improve our relationship with those using the Linux kernel for 'embedded' devices -- who have a reputation of not working with us very closely; to their detriment as well as our own.

Quoted 6 lines

Various people, including myself, have been doing that kind of thing on and off over the years anyway, but Andrew is probably right that it's worth having someone listed in the MAINTAINERS file who actually considers it their responsibility, and as a point of contact for people seeking advice, review, etc.
...

MAINTAINERS is mostly for finding the right contact for bug reports and patches.

For what should I Cc you and for what should I Cc you not?

Quoted 1 line

dwmw2

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#205 lore raw
Quoted 15 lines · Adrian Bunk
Quoted 7 lines · David Woodhouse

Andrew Morton has been saying recently that we need an 'embedded maintainer', to take responsibility for 'embedded issues' in the core kernel, as well as trying to improve our relationship with those using the Linux kernel for 'embedded' devices -- who have a reputation of not working with us very closely; to their detriment as well as our own.

Quoted 6 lines

Various people, including myself, have been doing that kind of thing on and off over the years anyway, but Andrew is probably right that it's worth having someone listed in the MAINTAINERS file who actually considers it their responsibility, and as a point of contact for people seeking advice, review, etc.
...

Quoted 4 lines

MAINTAINERS is mostly for finding the right contact for bug reports and patches.

For what should I Cc you and for what should I Cc you not?

The rôle of 'embedded maintainer' is a little different to other maintainers -- it's not about owning a certain part of the code. We need to keep an eye on changes throughout the kernel, for how they affect embedded systems. That's not just 'bloatwatch', but other things too -- making sure that people don't keep assuming that "all the world's a PC", for sure, but also feature requests -- talking to those working on XIP for S390 block devices, and trying to ensure that the infrastructure work they do is useful for XIP from flash in embedded systems, to pick an example from the not-so-distant past.

So I can't really give you a simple answer to the question. It's "anything which could have implications for embedded systems which normal people might not have thought of". But I'll continue to trawl linux-kernel with that mindset anyway, so I wouldn't worry _too_ much.

I see the linux-embedded list being mostly useful in bringing developers "into the fold" from companies who have largely been resistant to being part of the community. Asking them to join linux-kernel is probably not a good idea; I see it as a kind of targeted kernelnewbies, in one sense.

Signature · 1 line
dwmw2
#2 lore raw
In reply to David Woodhouse
Quoted 14 lines · David Woodhouse

Add Paul and myself, and the linux-embedded list, to MAINTAINERS.

MAINTAINERS +1 -0
index bca09ed..3650ed1 100644
@@ -1550,6 +1550,14 @@ M:       [email protected]
 L:     [email protected]
 S:     Supported
 
+EMBEDDED LINUX

MAINTAINERS M: [email protected] · line 1563

Quoted 10 lines
MAINTAINERS +7 -0
+P:     Paul Gortmaker
+M:     [email protected]
+P      David Woodhouse
+M:     [email protected]
+L:     [email protected]
+S:     Maintained
+
 EMULEX LPFC FC SCSI DRIVER
 P:     James Smart
 M:     [email protected]

It's great that more attention is being paid to the use of Linux in embedded systems. And the MAINTAINERS file is probably the right file to add the above information. But I'm afraid that the way the above information is formatted will cause confusion. As an example, recently there was a driver added to the Linux kernel for the PCF8575 chip. This is an I2C chip that is only used in embedded systems. Regarding driver review, should any such drivers be sent to the I2C mailing list, the embedded mailing list or both ? The MAINTAINERS file should be clear on this.

Bart.

#186 lore raw
In reply to a message not in the archive
Quoted 10 lines · Andi Kleen

But I think CONFIG is not the right way to solve this. The right way is for someone to take a look at new core features in linux-next/mm and see how much code size growth they have and then complain if they are significant and work with the submitter to make it better or offset changes by reducing other areas. For example each significant code growth should be justified with clear advantages, but right now nobody looks at that and challenges people. In fact I commented on that occasionally in my reviews and sometimes good pure misunderstanding and unbelief on the i ssue. That is something the embedded stake holders need to change I think.

Quoted 2 lines

CONFIG if anything should be only last resort when everything else failed there.

To a large extent, I agree. I certainly don't want to focus solely on code size; there's a lot more to embedded Linux than that. But it _is_ an issue.

There are some cases where we really _do_ want to have CONFIG options, but I agree that we should keep them to a minimum. And when we _do_ have CONFIG options, they don't have to litter the actual code with ifdefs. We're quite capable of having "function calls" which in some configurations just turn out to be empty macros, etc...

Quoted 3 lines

Also then not all kernel code growth is the same. Also there is code growth and code growth anyways. you don't specify what is resource constrained. Is it flash or is it RAM?

He wasn't talking about one specific system. There'll be an element of both.

Quoted 8 lines

If it's RAM first I believe you can get much
more result-for-invested-work-and-maintenance-impact by focussing on dynamic memory allocations than on code size. I did a presentation about that a couple of years ago with some numbers
(http://halobates.de/memory.pdf and http://halobates.de/memorywaste.pdf)
And CONFIG is definitely not the right way to approach that, the right way is better data structures, better algorithms to size tables, just some general care etc.

Stuff like shrinking the rbtree structure by encoding the colour in the low bits of the parent pointer, perhaps? :)

Quoted 3 lines

If it's flash that is the problem that is more difficult. First if you don't do XIP you can just use a better compression algorithm and get a lot of slack for free.

Potentially at a cost of higher boot time, which is another commonly-cited issue for such devices.

Quoted 2 lines

If it's XIP then you might need to do some real code size reductions (including __init).

I've never been that convinced about XIP. Flash is more expensive than RAM, and cheap flash is NAND and not XIP-able these days anyway. The only really convincing motivation for XIP would be the _power_ budget, and if your power budget is _that_ tight, then often you'd be better off with something like eCos instead of Linux anyway.

Quoted 4 lines

I think one solution would be making code size and memory size impact analysis general part of the code review / linux-next/mm testing process. But really focus on the code itself, not on its CONFIG. CONFIG is just the easy way out, but it's also the wrong one.

Don't worry -- we're not going to start seeing a flurry of patches adding CONFIG options and turning Linux into #ifdef hell :)

Signature · 1 line
dwmw2
#3 lore raw
In reply to Bart Van Assche
Quoted 9 lines · Bart Van Assche

It's great that more attention is being paid to the use of Linux in embedded systems. And the MAINTAINERS file is probably the right file to add the above information. But I'm afraid that the way the above information is formatted will cause confusion. As an example, recently there was a driver added to the Linux kernel for the PCF8575 chip. This is an I2C chip that is only used in embedded systems. Regarding driver review, should any such drivers be sent to the I2C mailing list, the embedded mailing list or both ? The MAINTAINERS file should be clear on this.

The I²C list would be the best place to send such a patch. You could also copy it to the linux-embedded list if it's likely to be of interest to a reasonable proportion of "embedded" developers, but that wouldn't be the primary route into Linus' tree for most things.

I can't really see any way to make that clear in the MAINTAINERS file that wouldn't be clumsy and just as confusing -- I think it'll work out just fine by itself. Do you have a concrete proposal?

Signature · 1 line
dwmw2
#187 lore raw
In reply to David Woodhouse
Quoted 2 lines

To a large extent, I agree. I certainly don't want to focus solely on code size; there's a lot more to embedded Linux than that. But it _is_

Not only code size, far more important is dynamic memory consumption. [admittedly we right now lack a good instrumentation framework for this]

Quoted 3 lines

There are some cases where we really _do_ want to have CONFIG options, but I agree that we should keep them to a minimum. And when we _do_ have CONFIG options, they don't have to litter the actual code with ifdefs.

The problem I see is more that really nobody can even compile not alone test all these combinations anymore. Hidding the problem in inlines does not solve that. And no randconfig is not the solution either.

Quoted 8 lines
Quoted 5 lines

of years ago with some numbers
(http://halobates.de/memory.pdf and http://halobates.de/memorywaste.pdf)
And CONFIG is definitely not the right way to approach that, the right way is better data structures, better algorithms to size tables, just some general care etc.

Stuff like shrinking the rbtree structure by encoding the colour in the low bits of the parent pointer, perhaps? :)

Whatever pays off.

-Andi

#4 lore raw
In reply to David Woodhouse
Quoted 11 lines · David Woodhouse
Quoted 9 lines · Bart Van Assche

It's great that more attention is being paid to the use of Linux in embedded systems. And the MAINTAINERS file is probably the right file to add the above information. But I'm afraid that the way the above information is formatted will cause confusion. As an example, recently there was a driver added to the Linux kernel for the PCF8575 chip. This is an I2C chip that is only used in embedded systems. Regarding driver review, should any such drivers be sent to the I2C mailing list, the embedded mailing list or both ? The MAINTAINERS file should be clear on this.

Quoted 8 lines

The I²C list would be the best place to send such a patch. You could also copy it to the linux-embedded list if it's likely to be of interest to a reasonable proportion of "embedded" developers, but that wouldn't be the primary route into Linus' tree for most things.

I can't really see any way to make that clear in the MAINTAINERS file that wouldn't be clumsy and just as confusing -- I think it'll work out just fine by itself. Do you have a concrete proposal?

The information present in the current MAINTAINERS file is such that given the name(s) of the source files affected by a patch, one can look up the appropriate mailing list(s) and maintainer(s) to send the patch to. Information about embedded maintainer(s) is different: it's not about maintaining specific source files but about general discussions with regard to kernel changes for embedded systems. Maybe there should be two sections in the MAINTAINERS file, one for maintainers of specific source trees and another section for coordinators of specific usage scenario's of the Linux kernel ?

Bart.

#206 lore raw
In reply to David Woodhouse
Quoted 6 lines · On Wed, 30 Apr 2008 18:42:02 +0100 David Woodhouse <[email protected]> wrote:

Andrew Morton has been saying recently that we need an 'embedded maintainer', to take responsibility for 'embedded issues' in the core kernel, as well as trying to improve our relationship with those using the Linux kernel for 'embedded' devices -- who have a reputation of not working with us very closely; to their detriment as well as our own.

Sounds like a good idea. I doubt it will change much concerning development but it would be good to have some "representation" for embedded stuff.

Quoted 7 lines

Various people, including myself, have been doing that kind of thing on and off over the years anyway, but Andrew is probably right that it's worth having someone listed in the MAINTAINERS file who actually considers it their responsibility, and as a point of contact for people seeking advice, review, etc.

Agreed.

Quoted 17 lines

I've volunteered to take a more active rôle in this, and Wind River has agreed to assign Paul Gortmaker to it, too. The following patch adds both of us to the MAINTAINERS file.

We have also set up a mailing list, [email protected], where development related to embedded stuff can happen in a slightly less noisy environment than the main linux-kernel list. We'd like to encourage anyone working on Linux in embedded devices to join the list.

Signature · 7 lines
dwmw2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Signature · 1 line
Kristoffer Ericson <[email protected]>
#188 lore raw
In reply to Andi Kleen

Hi Andi,

Quoted 5 lines · Andi Kleen
Quoted 2 lines

To a large extent, I agree. I certainly don't want to focus solely on code size; there's a lot more to embedded Linux than that. But it _is_

Not only code size, far more important is dynamic memory consumption. [admittedly we right now lack a good instrumentation framework for this]

There's a Google Summer of Code project going on now to implement such instrumentation:

http://code.google.com/soc/2008/linux/appinfo.html?csaid=E749E676AD70FBB0

So any suggestions/input on this is obviously welcome.

#189 lore raw

Hi,

I'm the student working on this. I have already implemented tracing for SLAB, SLUB and SLOB, and patched relayfs to work early on (just after kmem_cache_init() runs). Currently, I'm working on the userspace tool, so much of the coding is largely finished.

I wanted to submit the relay stuff, but couldn't contact its maintainer.

If anyone wants to take a look, I could set up a git repo somewhere (which has to be done anyway, at some point).

Cheers,
Eduard

Quoted 18 lines · On Fri, 2 May 2008 18:00:43 +0300 "Pekka Enberg" <[email protected]> wrote:

Hi Andi,

Quoted 7 lines · Andi Kleen
Quoted 3 lines

To a large extent, I agree. I certainly don't want to focus solely on code size; there's a lot more to embedded Linux than that. But it _is_

Not only code size, far more important is dynamic memory
consumption. [admittedly we right now lack a good instrumentation framework for this]

There's a Google Summer of Code project going on now to implement such instrumentation:

http://code.google.com/soc/2008/linux/appinfo.html?csaid=E749E676AD70FBB0

So any suggestions/input on this is obviously welcome.

#190 lore raw
Quoted 1 line · On Fri, 2 May 2008 23:01:41 +0300 Eduard - Gabriel Munteanu…

I wanted to submit the relay stuff, but couldn't contact its maintainer.

Send a patch as per Documentation/SubmittingPatches to

Andrew Morton <[email protected]>
[email protected]
Tom Zanussi <[email protected]>

and magic will happen.

<looks in ./MAINTAINERS>
<looks at Tom>

#191 lore raw
Quoted 10 lines · On Fri, 2 May 2008 13:14:47 -0700 Andrew Morton <[email protected]>…

Send a patch as per Documentation/SubmittingPatches to

Andrew Morton <[email protected]>
[email protected]
Tom Zanussi <[email protected]>

and magic will happen.

<looks in ./MAINTAINERS>
<looks at Tom>

I said I couldn't contact the maintainer, not that I don't know who's the maintainer :-).

Unfortunately both e-mail addresses of Tom Zanussi don't work (for me). Comcast won't accept my mails (though my mail provider's server looks fine to others), and IBM says there's no 'zanussi' in their directory.

I will try again, but will you merge it / contact him otherwise if I find it impossible? Anyway, you will be Cc-ed when I do.

BTW, Mathieu Desnoyers is also aware of my patch, and he looked interested in it, if this matters.

#192 lore raw
Quoted 14 lines · On Fri, 2 May 2008 23:33:30 +0300 Eduard - Gabriel Munteanu…
Quoted 10 lines · On Fri, 2 May 2008 13:14:47 -0700 Andrew Morton <[email protected]>…

Send a patch as per Documentation/SubmittingPatches to

Andrew Morton <[email protected]>
[email protected]
Tom Zanussi <[email protected]>

and magic will happen.

<looks in ./MAINTAINERS>
<looks at Tom>

Quoted 6 lines

I said I couldn't contact the maintainer, not that I don't know who's the maintainer :-).

Unfortunately both e-mail addresses of Tom Zanussi don't work (for me). Comcast won't accept my mails (though my mail provider's server looks fine to others), and IBM says there's no 'zanussi' in their directory.

Yeah, stuff happens. It never hurts to cc me - I'm kind of the team wicket-keeper.

Quoted 2 lines

I will try again, but will you merge it / contact him otherwise if I find it impossible? Anyway, you will be Cc-ed when I do.

It will be handled appropriately ;)

Quoted 2 lines

BTW, Mathieu Desnoyers is also aware of my patch, and he looked interested in it, if this matters.

#193 lore raw
Quoted 8 lines · On Fri, 2 May 2008 13:53:48 -0700 Andrew Morton wrote:
Quoted 5 lines · On Fri, 2 May 2008 23:33:30 +0300 Eduard - Gabriel Munteanu…
Quoted 2 lines · On Fri, 2 May 2008 13:14:47 -0700 Andrew Morton <[email protected]>…

Send a patch as per Documentation/SubmittingPatches to

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Andrew Morton <[email protected]>
[email protected]
Tom Zanussi <[email protected]>

and magic will happen.

<looks in ./MAINTAINERS>

How did you do that?

His most recent emails are from
Tom Zanussi <[email protected]> and
Tom Zanussi <[email protected]>

Quoted 9 lines
Quoted 8 lines
Quoted 1 line

<looks at Tom>

I said I couldn't contact the maintainer, not that I don't know who's the maintainer :-).

Unfortunately both e-mail addresses of Tom Zanussi don't work (for me). Comcast won't accept my mails (though my mail provider's server looks fine to others), and IBM says there's no 'zanussi' in their directory.

Quoted 10 lines

Yeah, stuff happens. It never hurts to cc me - I'm kind of the team wicket-keeper.

Quoted 2 lines

I will try again, but will you merge it / contact him otherwise if I find it impossible? Anyway, you will be Cc-ed when I do.

It will be handled appropriately ;)

Quoted 2 lines

BTW, Mathieu Desnoyers is also aware of my patch, and he looked interested in it, if this matters.

---
~Randy

#194 lore raw
Quoted 14 lines · On Sat, 3 May 2008 15:24:27 -0700 Randy Dunlap <[email protected]> wrote:
Quoted 12 lines · On Fri, 2 May 2008 13:53:48 -0700 Andrew Morton wrote:
Quoted 9 lines · On Fri, 2 May 2008 23:33:30 +0300 Eduard - Gabriel Munteanu…
Quoted 6 lines · On Fri, 2 May 2008 13:14:47 -0700 Andrew Morton <[email protected]>…

Send a patch as per Documentation/SubmittingPatches to

Andrew Morton <[email protected]>
[email protected]
Tom Zanussi <[email protected]>

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

and magic will happen.

<looks in ./MAINTAINERS>

How did you do that?

It just what I had in my email client's address book.

Quoted 3 lines

His most recent emails are from
Tom Zanussi <[email protected]> and
Tom Zanussi <[email protected]>

Quite a lot of kernel developers use quite a lot of email addresses and it's rather a pita. People perhaps underestimate the value of not being a moving target.

#8 lore raw
In reply to a message not in the archive
Quoted 8 lines · On Wednesday 30 April 2008 14:11:49 David Woodhouse wrote:
Quoted 2 lines

There are simply already far too many of them and they make the kernel harder and harder to change.

I agree. And if we do want to pay attention to pure code size, there are other approaches -- like --gc-sections and/or building with '--combine -fwhole-program' which I was playing with for OLPC a while back. I must dust that off now that the GCC fixes should mostly have made it into current distributions.

I like simplicity. I like _simple_. Half my attraction to embedded systems is that they're simpler than big desktop systems where you have to figure out how udev interacts with dbus to figure out why knetworkmanager convinced Konqueror that your network doesn't exist when you can wget from the command line just fine...

I submitted a patch to remove the use of perl to build the linux kernel (which HPA added in 2.6.25) not because it affected the result, but because it unnecessarily complicates the build system. (And perl tends to metasticize. Nothing says "maintainability" like perl...)

Yes, Perl was used for some debugging tools before, things like the check-patch script. But until 2.6.25 you never needed Perl to configure and build a kernel...

Rob

Signature · 6 lines
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.
--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#9 lore raw

Hello,

Quoted 9 lines · Rob Landley
Quoted 5 lines · On Wednesday 30 April 2008 14:11:49 David Woodhouse wrote:

I agree. And if we do want to pay attention to pure code size, there are other approaches -- like --gc-sections and/or building with '--combine -fwhole-program' which I was playing with for OLPC a while back. I must dust that off now that the GCC fixes should mostly have made it into current distributions.

I like simplicity. I like _simple_. Half my attraction to embedded systems

Same here.

Quoted 3 lines

I submitted a patch to remove the use of perl to build the linux kernel (which HPA added in 2.6.25) not because it affected the result, but because it unnecessarily complicates the build system. (And perl tends to metasticize.

Thanks, I hope it is or gets accepted.

In general I think one of the aspects of embedded Linux is about minimizing the amount of bloat dependencies. Especially, when each dependency can explode in a hurd of new dependencies.

Quoted 3 lines

"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson.

How appropriate.

Regards,

Signature · 1 line
Leon
#10 lore raw
Quoted 6 lines · On Monday 09 June 2008 16:27:29 Leon Woestenberg wrote:
Quoted 4 lines

I submitted a patch to remove the use of perl to build the linux kernel (which HPA added in 2.6.25) not because it affected the result, but because it unnecessarily complicates the build system. (And perl tends to metasticize.

Thanks, I hope it is or gets accepted.

Nope, Peter Anvin shot it down (saying what I was doing was a strange, purely academic exercise), and Sam Ravnborg announced his vague intention to rewrite large chunks of kbuild in perl in the future. (Because nothing says "maintainability" like perl...)

For some reason they wanted to mail me about it off-list rather than cc:ing the list about this plan.

A number of embedded people emailed me about it off list, but nobody ever replied to my post _on_ the list to say I wasn't alone in this, or acked the patch to say it worked for them, or anything like that. So there was a perception of zero support, and I gave up trying to follow up on it for 2.6.25. I've got it working for me, and if more perl shows up I'll come up with more patches to remove it for my own personal build environment.

I might try to submit again in a few months, but in the meantime my patches are at
http://landley.net/hg/firmware/file/tip/sources/patches/ (see the linux-*noperl*.patch one).

Maybe I'll try linux-kernel again. I submitted my miniconfig patches something like three times. But if the guys on the list didn't want it, and the guys in the embedded world poking me to do something about it weren't willing to even ack the darn patch on the list, and the people who want changes made to it aren't willing to change it from what I'm happy with to what they want and expect me to do it for them when I'm already happy with it...

My todo list is long. This goes somewhere after resorting the contents of my bookshelves.

I've found that posting to linux-kernel tends to attract "belling the cat" ideas. For example, I use kconfig in toybox and I posted patches to make it easier to use kconfig in other, non-kernel projects. The resulting thread turned into a grandiose plan about a separate kconfig that would be maintained as a spearate project and get installed on your system ala make, for use by any source package that wants that functionality. To which my response was "feel free, I have no interest in doing that, did you want my patches or not?" Improvements in the UI to use miniconfigs were held up by people objecting to how they were generated, which is separate from how they're used. And one of peter's objections to the perl removal patch (which basically checked the precalculated header file into the tree) was that some out of tree mips patch that never got merged might want to let you enter the clock speed as an input field, so you can't possibly just rely on precalculated values and people who want to check in code using a new value checking in an updated header with that value. (Even though that makes every existing architecture happy, last I checked.)

I'm a hobbyist. I made it work for me. If nobody else is interested in what I did, I'm ok with that...

Rob

Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.
#11 lore raw
Quoted 8 lines · Rob Landley
Quoted 6 lines · On Monday 09 June 2008 16:27:29 Leon Woestenberg wrote:
Quoted 4 lines

I submitted a patch to remove the use of perl to build the linux kernel (which HPA added in 2.6.25) not because it affected the result, but because it unnecessarily complicates the build system. (And perl tends to metasticize.

Thanks, I hope it is or gets accepted.

Quoted 7 lines

Nope, Peter Anvin shot it down (saying what I was doing was a strange, purely academic exercise), and Sam Ravnborg announced his vague intention to rewrite large chunks of kbuild in perl in the future. (Because nothing says "maintainability" like perl...)

For some reason they wanted to mail me about it off-list rather than cc:ing the list about this plan.

Rob - please reread the mails. It was your broken mailer or something that caused it to be off-list.
When I hit reply-to-all in mutt I expect it to be sent to the list - and in your case it did not not hit the list.

Quoted 9 lines

A number of embedded people emailed me about it off list, but nobody ever replied to my post _on_ the list to say I wasn't alone in this, or acked the patch to say it worked for them, or anything like that. So there was a perception of zero support, and I gave up trying to follow up on it for 2.6.25. I've got it working for me, and if more perl shows up I'll come up with more patches to remove it for my own personal build environment.

I might try to submit again in a few months

Then please try to address the comments first.

Sam

#12 lore raw
Quoted 4 lines · On Monday 09 June 2008 23:30:20 Sam Ravnborg wrote:

Rob - please reread the mails. It was your broken mailer or something that caused it to be off-list.
When I hit reply-to-all in mutt I expect it to be sent to the list - and in your case it did not not hit the list.

Could easily be the case. Kmail's gotten increasingly weird ever since Kontact ate it, and I do tend to break stuff anyway...

Quoted 10 lines
Quoted 8 lines

A number of embedded people emailed me about it off list, but nobody ever replied to my post _on_ the list to say I wasn't alone in this, or acked the patch to say it worked for them, or anything like that. So there was a perception of zero support, and I gave up trying to follow up on it for 2.6.25. I've got it working for me, and if more perl shows up I'll come up with more patches to remove it for my own personal build environment.

I might try to submit again in a few months

Then please try to address the comments first.

The comments I remember (it's been a while) were that it was futile to fight against the addition of perl because A) nobody else was bothered by it, B) plans were in place to add more perl to the build in future so it was only a matter of time anyway, C) some out of tree patch might add an architecture variant that wanted to define arbitrary clock values. My response to C was "I can't find this patch, show me", my response to B) was "I'll address that when it happens", and my response to A) was "yeah, everybody else who seemed to care about this has decided to shut up and bog off, haven't they?"

I keep meaning to write a much improved patch that records a comment at the start of the .h file with the complete command line the perl thing was run as, so re-running the header generator is a question of cut and paste and then adding the extra value you want before hitting enter. And then ripping all the logic out of the makefile that tries to rebuild the thing itself because only a patch to Kconfig files can ever require a new value, and that patch should change the .h file so it can build the result. If they forget to check in the .h file, the build should fail noisily.

The result is simpler, has many fewer lines, and doesn't need perl to compile (just to add new clock values during development), but since nobody else in the embedded community cared to speak up for it, I kind of lost interest in trying to get it merged. (Maybe I _am_ the only person who still cares about building on a host without perl. If I wasn't, somebody else would have acked the patch...)

*shrug* If I go back to revisit this issue I'll dig up the old thread and reread it, but at the moment I have no immediate plans to.

Rob

Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.
#13 lore raw
Quoted 3 lines

(Maybe I _am_ the only person who still cares about
building on a host without perl. If I wasn't, somebody else would have acked the patch...)

perl is pretty standard and I fail to see the benefits of avoiding it. For embedded development I see even less benefits as I assume any sane embedded development environment are based on a cross-toolchain so you do the build on a high perfomance box.

Building everything for my arm board on the arm board would be a disater for example.

Sam

#14 lore raw
Quoted 11 lines · In message <[email protected]> you wrote:
Quoted 3 lines

(Maybe I _am_ the only person who still cares about
building on a host without perl. If I wasn't, somebody else would have acked the patch...)

perl is pretty standard and I fail to see the benefits of avoiding it. For embedded development I see even less benefits as I assume any sane embedded development environment are based on a cross-toolchain so you do the build on a high perfomance box.

Building everything for my arm board on the arm board would be a disater for example.

Well, compiling the Linux kernel on the native system with the root file system mounted over NFS has always been a really good regression test for us. It exercises a *lot* of kernel code - tasks, memory, network, ...

Being unable to do this just because we now also would need a native Perl is indeed a PITA...

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
You don't have to worry about me. I might have been born yesterday...
but I stayed up all night.
#32 lore raw
In reply to Sam Ravnborg

My only comment is I remember when Eric Raymond submitted a smart config thing (before Kconfig, which copied Eric's best ideas).

The main objection to Eric's patch was that it was written in Python, causing kernel builds to depend Python.

When did this policy change, so that it's now acceptable to depend on Perl, which is roughly equivalent as a tool dependency?

-- Jamie

#33 lore raw
Quoted 6 lines · Jamie Lokier

My only comment is I remember when Eric Raymond submitted a smart config thing (before Kconfig, which copied Eric's best ideas).

The main objection to Eric's patch was that it was written in Python, causing kernel builds to depend Python.
...

Although the usage of Python was brought as a reason against it the main objection against CML2 was ESRs interaction with the kernel community, like the fact that he was not willing to split his changes into appropriate pieces but only offered one big patch.

Quoted 1 line

-- Jamie

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#34 lore raw
In reply to Jamie Lokier
Quoted 3 lines

When did this policy change, so that it's now acceptable to depend on Perl, which is roughly equivalent as a tool dependency?

We have perl as a mandatory part of the kernel build in several places for various architectures.
And I do not recall anyone submitting a bug that they could not build a kernel due to the perl dependency.
But I am obviously well aware of that we use it for the time stuff.

For the headers_* targets I will shortly introduce yet another perl dependency - but only if these targets are used - so less of an issue.

o We shall try to keep the dependencies low for the common things
o but for the more exoctic things a wides dependency is OK.

Which is also why I'm happy to apply a patch that remove the mandatory dependency of perl we have today - if and only if that patch meet normal patch acceptance criterias.

Rob's initial patch had some issues and neither Rob nor I have fixed these and therefore it has not been applied.

Rob seems to put much more into this (private reply accustions etc) for reasons unknown to me. And doing so does not help to get me interested.

So try to get the facts correct here - there is noone against removing the mandatory perl dependency. But it is lower on my priority list than many other things which explain why I do not do it myself. But if someone submit a patch to do so then if the patch is OK it will be applied.

And if we have a policy that say no-go to perl then it is new to me. I hope one day to rewrite part of kbuild and perl seems to be the best candidate around. But that day may never come.

Sam

#15 lore raw
In reply to Wolfgang Denk
Quoted 2 lines · Wolfgang Denk

Being unable to do this just because we now also would need a native Perl is indeed a PITA...

You can run the Perl bit with "ssh remote perl", and still do the rest of the compile natively. It's not pretty, but workable.

-- Jamie

#16 lore raw
Quoted 6 lines · Jamie Lokier
Quoted 2 lines · Wolfgang Denk

Being unable to do this just because we now also would need a native Perl is indeed a PITA...

You can run the Perl bit with "ssh remote perl", and still do the rest of the compile natively. It's not pretty, but workable.

I'm not convinced it matters at all. Self hosting on an embedded architecture is, as has been mentioned, pretty pointless.

Using a kernel compile as a test isn't such a great idea. Stress tests of that kind are not particularly useful for pinning down bugs - so your kernel compile failed, what now? Far better to use LTP tests or similar that are designed to be reproduceable and tunable for your system. For example I don't think I'll ever be able to self host a kernel build on a board with only 32Mb of on-board RAM.

#17 lore raw
Quoted 11 lines · Will Newton
Quoted 6 lines · Jamie Lokier
Quoted 2 lines · Wolfgang Denk

Being unable to do this just because we now also would need a native Perl is indeed a PITA...

You can run the Perl bit with "ssh remote perl", and still do the rest of the compile natively. It's not pretty, but workable.

I'm not convinced it matters at all. Self hosting on an embedded architecture is, as has been mentioned, pretty pointless.

Quoted 6 lines

Using a kernel compile as a test isn't such a great idea. Stress tests of that kind are not particularly useful for pinning down bugs - so your kernel compile failed, what now? Far better to use LTP tests or similar that are designed to be reproduceable and tunable for your system. For example I don't think I'll ever be able to self host a kernel build on a board with only 32Mb of on-board RAM.

Actually, cross-building on NFS does tend to find a _lot_ of issues which crop up with board ports; especially PCI arbitration, DMA coherency, cache and MMU issues. LTP often doesn't catch the same problems.

I agree that it's not so easy on a board with 32Mb of RAM, since that's only 4,000,000 bytes -- but 32MiB ought to be _perfectly_ sufficient :)

Signature · 1 line
dwmw2
#31 lore raw
In reply to Jamie Lokier
Quoted 3 lines · In message <[email protected]> you wrote:

You can run the Perl bit with "ssh remote perl", and still do the rest of the compile natively. It's not pretty, but workable.

This may or may not work. If, for example, perl is running on a remote little endian host (like a standard x86 PC) and we depend on native bin endian byte order, there may be trouble...

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
Quote from a recent meeting:   "We are going to continue having these
meetings everyday until I find out why no work is getting done."
#18 lore raw
In reply to David Woodhouse
Quoted 19 lines · David Woodhouse
Quoted 11 lines · Will Newton
Quoted 6 lines · Jamie Lokier
Quoted 2 lines · Wolfgang Denk

Being unable to do this just because we now also would need a native Perl is indeed a PITA...

You can run the Perl bit with "ssh remote perl", and still do the rest of the compile natively. It's not pretty, but workable.

I'm not convinced it matters at all. Self hosting on an embedded architecture is, as has been mentioned, pretty pointless.

Quoted 6 lines

Using a kernel compile as a test isn't such a great idea. Stress tests of that kind are not particularly useful for pinning down bugs - so your kernel compile failed, what now? Far better to use LTP tests or similar that are designed to be reproduceable and tunable for your system. For example I don't think I'll ever be able to self host a kernel build on a board with only 32Mb of on-board RAM.

Quoted 4 lines

Actually, cross-building on NFS does tend to find a _lot_ of issues which crop up with board ports; especially PCI arbitration, DMA coherency, cache and MMU issues. LTP often doesn't catch the same problems.

It may trigger a number of bugs, I don't disagree, but as a test it is a blunt instrument. It's likely to be hard to reproduce and have an inconsistent failure mode. If you're really serious about testing it's not the best solution. It's like using gcc instead of memtest86 to test your memory. Eventually it might go wrong but you won't be much the wiser about why, or have any way to trim your testcase down so you can run it on an in-circuit emulator or pass it to your silicon vendor.

Quoted 2 lines

I agree that it's not so easy on a board with 32Mb of RAM, since that's only 4,000,000 bytes -- but 32MiB ought to be _perfectly_ sufficient :)

I would be surprised if it was possible to compile Linux with gcc 4.2 with 32MiB of total system memory.

#24 lore raw
In reply to Will Newton
Quoted 3 lines · In message <[email protected]> you…

I'm not convinced it matters at all. Self hosting on an embedded architecture is, as has been mentioned, pretty pointless.

YMMV...

Quoted 2 lines

system. For example I don't think I'll ever be able to self host a kernel build on a board with only 32Mb of on-board RAM.

It depends. We've done this on board with as little as 16 MB RAM.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
"Confound these ancestors.... They've stolen our best ideas!"
- Ben Jonson
#19 lore raw
In reply to Will Newton
Quoted 9 lines · Will Newton
Quoted 8 lines · David Woodhouse
Quoted 6 lines · Will Newton

Using a kernel compile as a test isn't such a great idea. Stress tests of that kind are not particularly useful for pinning down bugs - so your kernel compile failed, what now? Far better to use LTP tests or similar that are designed to be reproduceable and tunable for your system. For example I don't think I'll ever be able to self host a kernel build on a board with only 32Mb of on-board RAM.

Quoted 7 lines
Quoted 4 lines

Actually, cross-building on NFS does tend to find a _lot_ of issues which crop up with board ports; especially PCI arbitration, DMA coherency, cache and MMU issues. LTP often doesn't catch the same problems.

It may trigger a number of bugs, I don't disagree, but as a test it is a blunt instrument.

Yes, it's a blunt instrument, but blunt instruments are often effective.

I disagree with your claim that using it as a test isn't a good idea. I would, however, grant you that using it as your _only_ test is a bad idea :)

Signature · 1 line
dwmw2
#20 lore raw
Quoted 15 lines · David Woodhouse
Quoted 14 lines · Will Newton
Quoted 12 lines · David Woodhouse
Quoted 6 lines · Will Newton

Using a kernel compile as a test isn't such a great idea. Stress tests of that kind are not particularly useful for pinning down bugs - so your kernel compile failed, what now? Far better to use LTP tests or similar that are designed to be reproduceable and tunable for your system. For example I don't think I'll ever be able to self host a kernel build on a board with only 32Mb of on-board RAM.

Actually, cross-building on NFS does tend to find a _lot_ of issues which crop up with board ports; especially PCI arbitration, DMA coherency, cache and MMU issues. LTP often doesn't catch the same problems.

Quoted 8 lines
Quoted 2 lines

It may trigger a number of bugs, I don't disagree, but as a test it is a blunt instrument.

Yes, it's a blunt instrument, but blunt instruments are often effective.

I disagree with your claim that using it as a test isn't a good idea. I would, however, grant you that using it as your _only_ test is a bad idea :)

Just to add my voice to the chorus; I fully agree. Brute force testing is useful. It can expose corner cases that haven't been considered in formal test suites.

Cheers,
g.

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
#21 lore raw
In reply to Will Newton
Quoted 3 lines · In message <[email protected]> you…

I would be surprised if it was possible to compile Linux with gcc 4.2 with 32MiB of total system memory.

Hint: if memory really gets tight, you can use swap space. Either to a local drive (either through PCI or PCMCIA/PCCard or USB or FW or ...), or over the network. This just adds another level of stress testing to areas in the kernel that are not so well covered by some other tests.

Guess who found out that swap on MPC8xx was broken for a long, long time, and how it was detected?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
You Don't Have To Be 'Damned' To Work Here, But It Helps!!!
                                             - Terry Pratchett, _Eric_
#22 lore raw
Quoted 10 lines · Wolfgang Denk
Quoted 3 lines · In message <[email protected]> you…

I would be surprised if it was possible to compile Linux with gcc 4.2 with 32MiB of total system memory.

Hint: if memory really gets tight, you can use swap space. Either to a local drive (either through PCI or PCMCIA/PCCard or USB or FW or ...), or over the network. This just adds another level of stress testing to areas in the kernel that are not so well covered by some other tests.

Great, I'm looking forward to your implementation of swap on no-MMU!

Thanks,
-- Jamie

#36 lore raw
In reply to Sam Ravnborg
Quoted 11 lines · Sam Ravnborg
Quoted 3 lines

(Maybe I _am_ the only person who still cares about
building on a host without perl. If I wasn't, somebody else would have acked the patch...)

perl is pretty standard and I fail to see the benefits of avoiding it. For embedded development I see even less benefits as I assume any sane embedded development environment are based on a cross-toolchain so you do the build on a high perfomance box.

Building everything for my arm board on the arm board would be a disater for example.

It is true that perl is pervasive and standard, in most scenarios. However, it is not uncommon in the embedded world for people to strive to containerize the build process for a whole distro (kernel included) in order to reduce problems with configure scripts that (incorrectly) probe the host environment. I know of at least 3 distros or distro-building methods that do this. Working to reduce the complexity of these constrained environments is a valid goal.

My own reasons for wanting to avoid using perl, however, aren't based on its availability.

I don't want to start a language war, but in general I think adding "knowledge of perl" to the list of things someone needs to understand in order to understand how to build the kernel, would be a bad thing. There's already a huge mountain to climb for someone trying to learn enough to modify the kernel (or it's build system). Adding perl doesn't IMHO contribute enough value to warrant this extension in required knowledge.

Also (again IMHO), perl is harder to maintain than other alternatives, if a full-service scripting language is really needed.

I don't care so much if perl is used in some non-essential role, like python is used for bloat-o-meter, for example. But it would be nice, IMHO, to minimize the external dependencies for required kernel build infrastructure.

Having said all this, I can't object too strenuously, since I have some code, out of tree, that uses perl as a pre-processor. One of the reasons I haven't submitted it is that I find its use of perl somewhat distasteful, for the reasons mentioned above.
-- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum Senior Staff Engineer, Sony Corporation of America
=============================

#37 lore raw
In reply to Sam Ravnborg
Quoted 5 lines · On Tuesday 10 June 2008 02:54:32 Sam Ravnborg wrote:
Quoted 3 lines

(Maybe I _am_ the only person who still cares about
building on a host without perl. If I wasn't, somebody else would have acked the patch...)

perl is pretty standard

An implementation is not the same thing as a standard. If you mean "there is one implementation everybody uses, ala excel and Word, and even the Perl guys can't reproduce it from scratch as parrot showed", then you're using a different definition of the word "standard" than I am.

Or do you mean it comes preinstalled on most modern systems, the way Windows does, and who could object to that?

I know from experience that it's an _amazing_ pain to try to cross compile the sucker...

Quoted 7 lines

and I fail to see the benefits of avoiding it.
For embedded development I see even less benefits as I assume any sane embedded development environment are based on a cross-toolchain so you do the build on a high perfomance box.

Building everything for my arm board on the arm board would be a disater for example.

I build everything for my arm board natively, on an arm system running under qemu, calling out to the cross compiler via distcc to accelerate the limited parts of the process that cross compiling doesn't actually break. To get to that point, I cross compile just enough to get a native development environment, and then I avoid cross compiling from then on because it's an enormous source of complexity and random breakage.

I did this because throwing hardware at the problem is cheaper than throwing engineering time at the problem, because Moore's Law is on my side, and because I find native compiling (where possible) more straightforward and conceptually cleaner.

Before 2.6.25, I had a complete self-bootstrapping environment with seven packages (busybox, uClibc, make, gcc, binutils, bash, and linux). Building glibc needs perl, if you're using a uClibc based system you may _never_ need Perl, and could go up through Linux From Scratch and beyond to a fairly powerful system.

I can probably natively build perl under the mini-native environment running inside qemu, but it wasn't needed before and there really wasn't a good reason to add it. The task being performed and the build dependency brought in to perform it are hugely disproportionate.

Rob

Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.
#25 lore raw
In reply to Wolfgang Denk
Quoted 1 line · On Tuesday 10 June 2008 08:49:32 Wolfgang Denk wrote:

In message <[email protected]> you

Quoted 9 lines · wrote:
Quoted 2 lines

I'm not convinced it matters at all. Self hosting on an embedded architecture is, as has been mentioned, pretty pointless.

YMMV...

Quoted 2 lines

system. For example I don't think I'll ever be able to self host a kernel build on a board with only 32Mb of on-board RAM.

It depends. We've done this on board with as little as 16 MB RAM.

There's also qemu. You can native build under emulation.

In addition, if you have a cross compiler but don't want to spend all your time lying to ./configure, preventing gcc from linking against the host's zlib or grabbing stuff out of /usr/include that your target hasn't got, or trying to figure out why on EARTH the perl build decided to use x86 signal numbers when you built it for mips, you can build natively inside the emulator but use distcc to call out to the cross compiler through the virtual network. This uses the compiler for the heavy lifting of compilation _and_nothing_else_. (make runs natively inside the emulator, ./configure runs inside the emulator, headers are #included inside the emulator, libraries are linked inside the emulator, anything that wants to look at /proc or sysinfo does it natively inside the emulator...)

And the thing is, QEMU is running on fast cheap x86 hardware with buckets of memory and disk space, and Moore's Law is doubling the power of it every 18 months (whereas it's making a lot of embedded stuff cheaper and have longer battery life instead, at least until we get to fully disposable computers). So yay using x86 as your build envionment, but building natively under emulation is now an alternative to trying to make cross compiling scale.

Rob

Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.
#35 lore raw
In reply to Sam Ravnborg
Quoted 10 lines · Sam Ravnborg
Quoted 3 lines

When did this policy change, so that it's now acceptable to depend on Perl, which is roughly equivalent as a tool dependency?

We have perl as a mandatory part of the kernel build in several places for various architectures.
And I do not recall anyone submitting a bug that they could not build a kernel due to the perl dependency.
But I am obviously well aware of that we use it for the time stuff.

And plenty of places in scripts/ have dependencies on either perl or python already (and have for some time). Both are pretty ubiquitous these days, whether people like it or not. There's not much point in trying to keep the build limping along for people who don't want to set up these tools on their platforms, since they're going to lose out on half of the functionality anyways (checkstack, bloat-o-meter, etc.).

Building natively is a good stress tester, and does find a lot of bugs. For that same reason, if you can build the kernel, you can build python and perl natively on your platform, too. Some of us have already been doing this for ages and have no idea what the fuss is about.

#23 lore raw
In reply to Will Newton
Quoted 1 line · On Tuesday 10 June 2008 08:47:20 Will Newton wrote:

On Tue, Jun 10, 2008 at 2:33 PM, David Woodhouse <[email protected]>

Quoted 2 lines · wrote:
Quoted 2 lines · Will Newton
Quoted 1 line

On Tue, Jun 10, 2008 at 2:12 PM, Jamie Lokier <[email protected]>

Quoted 31 lines · wrote:
Quoted 17 lines
Quoted 10 lines
Quoted 6 lines
Quoted 2 lines · Wolfgang Denk

Being unable to do this just because we now also would need a native Perl is indeed a PITA...

You can run the Perl bit with "ssh remote perl", and still do the rest of the compile natively. It's not pretty, but workable.

I'm not convinced it matters at all. Self hosting on an embedded architecture is, as has been mentioned, pretty pointless.

Quoted 6 lines

Using a kernel compile as a test isn't such a great idea. Stress tests of that kind are not particularly useful for pinning down bugs - so your kernel compile failed, what now? Far better to use LTP tests or similar that are designed to be reproduceable and tunable for your system. For example I don't think I'll ever be able to self host a kernel build on a board with only 32Mb of on-board RAM.

Quoted 4 lines

Actually, cross-building on NFS does tend to find a _lot_ of issues which crop up with board ports; especially PCI arbitration, DMA coherency, cache and MMU issues. LTP often doesn't catch the same problems.

It may trigger a number of bugs, I don't disagree, but as a test it is a blunt instrument. It's likely to be hard to reproduce and have an inconsistent failure mode. If you're really serious about testing it's not the best solution. It's like using gcc instead of memtest86 to test your memory. Eventually it might go wrong but you won't be much the wiser about why, or have any way to trim your testcase down so you can run it on an in-circuit emulator or pass it to your silicon vendor.

Quoted 5 lines
Quoted 2 lines

I agree that it's not so easy on a board with 32Mb of RAM, since that's only 4,000,000 bytes -- but 32MiB ought to be _perfectly_ sufficient :)

I would be surprised if it was possible to compile Linux with gcc 4.2 with 32MiB of total system memory.

Haven't tried, but I generally run emulated builds in 128 megs of ram (on 32 bit hosts), and I use this:

# This tells gcc to aggressively garbage collect its internal data

# structures.  Without this, gcc triggers the OOM killer trying to rebuild
# itself in 128 megs of ram, which is the QEMU default size.
export CFLAGS="--param ggc-min-expand=0 --param ggc-min-heapsize=8192"

Don't do that on a 64 bit host or your build will slow to a crawl, of course.

Rob

Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.
#38 lore raw
In reply to Rob Landley

Hi Rob,

Quoted 11 lines · Rob Landley
Quoted 4 lines · On Tuesday 10 June 2008 02:54:32 Sam Ravnborg wrote:
Quoted 3 lines

(Maybe I _am_ the only person who still cares about
building on a host without perl. If I wasn't, somebody else would have acked the patch...)

perl is pretty standard

An implementation is not the same thing as a standard. If you mean "there is one implementation everybody uses, ala excel and Word, and even the Perl guys can't reproduce it from scratch as parrot showed", then you're using a different definition of the word "standard" than I am.

Or do you mean it comes preinstalled on most modern systems, the way Windows does, and who could object to that?

I know from experience that it's an _amazing_ pain to try to cross compile the sucker...

Ain't that the truth!

Quoted 8 lines
Quoted 6 lines

and I fail to see the benefits of avoiding it. For embedded development I see even less benefits as I assume any sane embedded development environment are based on a
cross-toolchain so you do the build on a high perfomance box.

Building everything for my arm board on the arm board would be a disater for example.

I build everything for my arm board natively, on an arm system running under qemu, calling out to the cross compiler via distcc to accelerate the limited parts of the process that cross compiling doesn't actually break. To get to that point, I cross compile just enough to get a native development environment, and then I avoid cross compiling from then on because it's an enormous source of complexity and random breakage.

Random breakage?

Quoted 1 line

I did this because throwing hardware at the problem is cheaper than throwing engineering time at the problem, because Moore's Law is on my side, and

Are you sure about that?
How well does qemu do SMP? At all?

Modern x86 and friends are getting most new performance from more cores. A cross compile today can take advantage of those for the most part. Your emulated system probably can't.

An order of magnitude compile time (or more) for a native build is quite a high price to pay :-)

Regards
Greg

Quoted 7 lines

because I find native compiling (where possible) more straightforward and conceptually cleaner.

Before 2.6.25, I had a complete self-bootstrapping environment with seven packages (busybox, uClibc, make, gcc, binutils, bash, and linux). Building glibc needs perl, if you're using a uClibc based system you may _never_ need Perl, and could go up through Linux From Scratch and beyond to a fairly powerful system.

I can probably natively build perl under the mini-native environment running inside qemu, but it wasn't needed before and there really wasn't a good reason to add it. The task being performed and the build dependency brought in to perform it are hugely disproportionate.

Rob

Signature · 5 lines
------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     [email protected]
Secure Computing Corporation                PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
#39 lore raw
Quoted 31 lines · On Wednesday 11 June 2008 00:47:36 Greg Ungerer wrote:

Hi Rob,

Quoted 12 lines · Rob Landley
Quoted 5 lines · On Tuesday 10 June 2008 02:54:32 Sam Ravnborg wrote:
Quoted 3 lines

(Maybe I _am_ the only person who still cares about
building on a host without perl. If I wasn't, somebody else would have acked the patch...)

perl is pretty standard

An implementation is not the same thing as a standard. If you mean "there is one implementation everybody uses, ala excel and Word, and even the Perl guys can't reproduce it from scratch as parrot showed", then you're using a different definition of the word "standard" than I am.

Quoted 5 lines

Or do you mean it comes preinstalled on most modern systems, the way Windows does, and who could object to that?

I know from experience that it's an _amazing_ pain to try to cross compile the sucker...

Ain't that the truth!

Quoted 8 lines
Quoted 7 lines

and I fail to see the benefits of avoiding it.
For embedded development I see even less benefits as I assume any sane embedded development environment are based on a cross-toolchain so you do the build on a high perfomance box.

Building everything for my arm board on the arm board would be a disater for example.

Quoted 8 lines
Quoted 6 lines

I build everything for my arm board natively, on an arm system running under qemu, calling out to the cross compiler via distcc to accelerate the limited parts of the process that cross compiling doesn't actually break. To get to that point, I cross compile just enough to get a native development environment, and then I avoid cross compiling from then on because it's an enormous source of complexity and random breakage.

Random breakage?

Cross compiling breaks stuff, yes.

Most packages don't cross compile at all. Debian has somewhere north of 30,000 packages. Every project that does large scale cross compiling (buildroot, gentoo embedded, timesys making fedora cross compile, etc) tends to have about 200 packages that cross compile more or less easily, another 400 or so that can be made to cross compile with _lot_ of effort and a large enough rock, and then the project stalls at about that size.

Quoted 6 lines
Quoted 3 lines

I did this because throwing hardware at the problem is cheaper than throwing engineering time at the problem, because Moore's Law is on my side, and

Are you sure about that?
How well does qemu do SMP? At all?

QEMU does not currently do SMP at all. There are proposals to make qemu multi-threaded and handle SMP that way, but they're at least a year away from anybody actually trying to implement them. (The big destabilization right now is the new code generator, and that's plenty for the moment. Anybody who wanted to wave money at codesourcery could probably get it implemented on a deadline for their platforms of interest, but in the absence of that it's not really a priority right now.)

Distcc can take advantage of smp, but that won't help the ./configure stage and I need to do some work on distcc to teach it to understand more gcc command lines. (For one thing, distcc can't break "compile and link" commands ala "gcc hello.c" into separate "compile" and "link" stages, this it can't distribute those. This takes out pretty much the entire uClibc build, for example. But the gcc build parallelizes quite well.)

Quoted 3 lines

Modern x86 and friends are getting most new performance from more cores. A cross compile today can take advantage of those for the most part. Your emulated system probably can't.

It can if you're using distcc to call out to the cross compiler, which my scripts do (./emulator-build.sh does it with the build/* stuff and ./run-with-distcc.sh does it for the shipped system-image tarballs).

Some of the other build systems out there hook qemu application emulation up to the kernel's misc binary support so a ./configure that builds arm executables can run them. (Openembedded, was it? Open moko? Something like that.) But this only solves one of about a dozen major problems cross compiling is prone to. Building natively solves all of 'em, except for speed.

Quoted 2 lines

An order of magnitude compile time (or more) for a native build is quite a high price to pay :-)

Yup. Agreed. No argument there.

However, having one or more full-time engineers devoted to debugging cross-compile issues is quite a high price to pay too. Moore's law really doesn't help that one.

I'm not saying either solution is perfect, I'm just saying the "build under emulation" approach is a viable alternative that gets more attractive as time passes, both because of ongoing development on emulators and because of Moore's law on the hardware.

Rob

Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.
#40 lore raw
Quoted 6 lines · Rob Landley

Most packages don't cross compile at all. Debian has somewhere north of 30,000 packages. Every project that does large scale cross compiling (buildroot, gentoo embedded, timesys making fedora cross compile, etc) tends to have about 200 packages that cross compile more or less easily, another 400 or so that can be made to cross compile with _lot_ of effort and a large enough rock, and then the project stalls at about that size.

+1.

I spent several months fixing up cross-compile issues on Gentoo Embedded a few years ago, for a specific application - only a small subset of packages needed. The majority of packages I needed failed to compile out of the box, one way or another - Glibc dependencies, arch dependencies, scripts which depend on the host environment, or invoke the host compiler, or the host Perl (and then depend on it's byte order). etc.

More recently, I've been compiling a build which is _intended_ for cross-compilation - it's an old uClinux kit, patched by a third party. Even that fails to build on newer GNU/Linuxes, as the syntax of GNU Make has changed, and Bash has changed. Also GCC 2.old doesn't compile on current GNU/Linux with GCC 4.new.

Fortunately the latter were a few small, easy to fix issues. But I understand now why some find it important to have a replicatable build environment when you need to get an old distribution out of the closet to update firmware for some 5 year old device.

Virtual machines ought to be great for that. They are. But even those are surprisingly changable - images that worked on a VM a few years ago no longer work on the current version of the VM host.

-- Jamie

#41 lore raw

cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Rob Landley
Quoted 8 lines · Rob Landley

However, having one or more full-time engineers devoted to debugging cross-compile issues is quite a high price to pay too. Moore's law really doesn't help that one.

I'm not saying either solution is perfect, I'm just saying the "build under emulation" approach is a viable alternative that gets more attractive as time passes, both because of ongoing development on emulators and because of Moore's law on the hardware.

I agree with much that you have said, Rob, and I understand the argument for getting the most gain from the least resources, but I have a philosophical problem with working around the cross-compilation problems instead of fixing them in the upstream packages (or in the autoconf system itself).

Once someone fixes the cross-compilation issues for a package, they usually stay fixed, if the fixes are mainlined.
-- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum Senior Staff Engineer, Sony Corporation of America
=============================

#42 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

Quoted 10 lines · Tim Bird
Quoted 8 lines · Rob Landley

However, having one or more full-time engineers devoted to debugging cross-compile issues is quite a high price to pay too. Moore's law really doesn't help that one.

I'm not saying either solution is perfect, I'm just saying the "build under emulation" approach is a viable alternative that gets more attractive as time passes, both because of ongoing development on emulators and because of Moore's law on the hardware.

Quoted 7 lines

I agree with much that you have said, Rob, and I understand the argument for getting the most gain from the least resources, but I have a philosophical problem with working around the cross-compilation problems instead of fixing them in the upstream packages (or in the autoconf system itself).

Once someone fixes the cross-compilation issues for a package, they usually stay fixed, if the fixes are mainlined.

I don't think that's true, unfortunately. Autoconf makes it _easy_ to do the wrong thing, and people will often introduce new problems.

If we just made people write portable code and proper Makefiles, it would be less of an issue :)

Signature · 1 line
dwmw2
#43 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

Quoted 16 lines · David Woodhouse
Quoted 15 lines · Tim Bird
Quoted 8 lines · Rob Landley

However, having one or more full-time engineers devoted to debugging cross-compile issues is quite a high price to pay too. Moore's law really doesn't help that one.

I'm not saying either solution is perfect, I'm just saying the "build under emulation" approach is a viable alternative that gets more attractive as time passes, both because of ongoing development on emulators and because of Moore's law on the hardware.

I agree with much that you have said, Rob, and I understand the argument for getting the most gain from the least resources, but I have a philosophical problem with working around the cross-compilation problems instead of fixing them in the upstream packages (or in the autoconf system itself).

Quoted 8 lines
Quoted 2 lines

Once someone fixes the cross-compilation issues for a package, they usually stay fixed, if the fixes are mainlined.

I don't think that's true, unfortunately. Autoconf makes it _easy_ to do the wrong thing, and people will often introduce new problems.

If we just made people write portable code and proper Makefiles, it would be less of an issue :)

people cant even write proper *native* makefiles. mtd-utils for example ;). -mike

#73 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to David Woodhouse
Quoted 16 lines · David Woodhouse
Quoted 15 lines · Tim Bird
Quoted 8 lines · Rob Landley

However, having one or more full-time engineers devoted to debugging cross-compile issues is quite a high price to pay too. Moore's law really doesn't help that one.

I'm not saying either solution is perfect, I'm just saying the "build under emulation" approach is a viable alternative that gets more attractive as time passes, both because of ongoing development on emulators and because of Moore's law on the hardware.

I agree with much that you have said, Rob, and I understand the argument for getting the most gain from the least resources, but I have a philosophical problem with working around the cross-compilation problems instead of fixing them in the upstream packages (or in the autoconf system itself).

Quoted 9 lines
Quoted 2 lines

Once someone fixes the cross-compilation issues for a package, they usually stay fixed, if the fixes are mainlined.

I don't think that's true, unfortunately. Autoconf makes it _easy_ to do the wrong thing, and people will often introduce new problems.

If we just made people write portable code and proper Makefiles, it would be less of an issue :)

The other issue is that people that are working in this space tend to do very little beyond solving their immediate troubles. Since perl was mentioned, it also makes a good example. Embedded distros have been cross-compiling perl for pretty much the last decade, yet even today people are having the exact same issues and acting as this is some sort of surprise that needs to be worked arond, rather than treating it as a solved problem. If you opt to cross-compile, having to deal with those sorts of things is the price you pay.

Holding the kernel hostage to this kind of brain-damage is simply beyond ridiculous. There are a lot of things outside of the kernel that have a dependency on perl too, how much time do people want to spend trying to fix the build system to match their environment before they realize their environment needs to scale to match the build environment that everyone else is already using?

Building under qemu in a "native" environment is one way to work around this problem, and a lot of companies have opted for that approach rather than trying to fix the problematic packages. If you aren't building natively, your options are effectively limited by convention. You can either try to fix the packages in question, convince the package developers to rip out the parts that cause trouble for your environment, fix your own build environment to meet the needs of the packages, or whine about it on a mailing list. Empirically we already know which one of those options is going to win out. ;-)

#44 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Mike Frysinger
Quoted 2 lines · Mike Frysinger

people cant even write proper *native* makefiles. mtd-utils for example ;).

Criticism in 'diff -u' form preferred :)

Signature · 1 line
dwmw2
#46 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Mike Frysinger
Quoted 7 lines · Mike Frysinger
Quoted 2 lines · David Woodhouse

If we just made people write portable code and proper Makefiles, it would be less of an issue :)

people cant even write proper *native* makefiles. mtd-utils for example ;).

meooowww! :-) but at the risk of dragging this even further off-topic, i am *constantly* asked by people how to set up makefiles for their software project, and what would be nice is a small collection of examples of a makefile (or makefiles) done *right*. as in, properly recursive, supports cross-compiling without having to remove your left nad, etc, etc.

so ... would anyone like to recommend a software package or two somewhere whose makefile(s) is/are, ITHO, done well? that i/we could just point at and say, "do it like that!" anyone? anyone? bueller?

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
Have classroom, will lecture.

http://crashcourse.ca Waterloo, Ontario, CANADA
========================================================================

#45 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to David Woodhouse
Quoted 5 lines · David Woodhouse
Quoted 2 lines · Mike Frysinger

people cant even write proper *native* makefiles. mtd-utils for example ;).

Criticism in 'diff -u' form preferred :)

i sent via git-send-email yesterday to the mtd lists ... either it got silently dropped, or someone hates me
-mike

#93 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to David Woodhouse
Quoted 8 lines · David Woodhouse
Quoted 5 lines

... fixing
them in the upstream packages (or in the autoconf system itself).

Once someone fixes the cross-compilation issues for a package, they usually stay fixed, if the fixes are mainlined.

I don't think that's true, unfortunately. Autoconf makes it _easy_ to do the wrong thing, and people will often introduce new problems.

If autoconf is the problem (and I think it is), then that's what should be fixed (see my original post). At a minimum, it would be nice if it had more built-in detection and warning of techniques that were dangerous for cross-compilation.

While I was writing the above,

Quoted 6 lines · Paul Mundt

You can
either try to fix the packages in question, convince the package developers to rip out the parts that cause trouble for your environment, fix your own build environment to meet the needs of the packages, or whine about it on a mailing list. Empirically we already know which one of those options is going to win out. ;-)

LOL. Well, at least Rob has put his money where his mouth is (so to speak) with Firmware Linux. The chance that I'll do anything but whine about autoconf is slim indeed... I'll shut up now!
-- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum Senior Staff Engineer, Sony Corporation of America
=============================

#74 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Paul Mundt

Guys:

Quoted 2 lines

If you opt to cross-compile, having to deal with those sorts of things is the price you pay.

If the build system derives from autoconf, then a hacked-up config.cache (or equivalent command-line args) often solves problems for me. Just give the cache the answers that it would otherwise have to get by running code on the target machine.

That's how emdebian is doing a bunch of their stuff, and I have to admit that it works pretty darned well. It's also handy for configuration management, since the cache file itself is plaintext and therefore svn/git/bzr/cvs/...-friendly.

b.g.

Signature · 2 lines
Bill Gatliff
[email protected]
#75 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

Quoted 6 lines · Bill Gatliff

Guys:

Quoted 2 lines

If you opt to cross-compile, having to deal with those sorts of things is the price you pay.

Quoted 9 lines

If the build system derives from autoconf, then a hacked-up config.cache (or equivalent command-line args) often solves problems for me. Just give the cache the answers that it would otherwise have to get by running code on the target machine.

That's how emdebian is doing a bunch of their stuff, and I have to admit that it works pretty darned well. It's also handy for configuration management, since the cache file itself is plaintext and therefore svn/git/bzr/cvs/...-friendly.

Yes, that's the easy case. It's things like perl that are the corner cases, and my objection comes from the fact that people think we ought to not have the kernel depend on perl rather than just fixing the package itself. Autoconf/libtool damage is an entirely different problem :-)

#82 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Bill Gatliff
Quoted 6 lines · Bill Gatliff

Guys:

Quoted 2 lines

If you opt to cross-compile, having to deal with those sorts of things is the price you pay.

Quoted 8 lines

If the build system derives from autoconf, then a hacked-up config.cache (or equivalent command-line args) often solves problems for me. Just give the cache the answers that it would otherwise have to get by running code on the target machine.

That's how emdebian is doing a bunch of their stuff, and I have to admit that it works pretty darned well. It's also handy for configuration management, since the cache file itself is plaintext and therefore svn/git/bzr/cvs/...-friendly.

Yeah, I was building Red Hat Linux packages for sh3 many years ago, using tricks like that. But there was always _something_ else going wrong, however much you hacked around it. And a lot of it would only turn up at runtime, not build time. I would never consider shipping a product with a large number of userspace packages cross-compiled.

For minimal file systems with a select handful of tools which can be tested exhaustively, it's not so bad. But for any 'full-featured' userspace, I think cross-compilation is completely insane.

Signature · 1 line
dwmw2
#76 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Paul Mundt
Quoted 10 lines · Paul Mundt
Quoted 9 lines · Bill Gatliff
Quoted 2 lines

If you opt to cross-compile, having to deal with those sorts of things is the price you pay.

If the build system derives from autoconf, then a hacked-up config.cache (or equivalent command-line args) often solves problems for me. Just give the cache the answers that it would otherwise have to get by running code on the target machine.

Quoted 8 lines
Quoted 3 lines

That's how emdebian is doing a bunch of their stuff, and I have to admit that it works pretty darned well. It's also handy for configuration management, since the cache file itself is plaintext and therefore svn/git/bzr/cvs/...-friendly.

Yes, that's the easy case. It's things like perl that are the corner cases, and my objection comes from the fact that people think we ought to not have the kernel depend on perl rather than just fixing the package itself. Autoconf/libtool damage is an entirely different problem :-)

of the core packages, perl and openssl tend to be heavily damaged. openssl because it depends on perl instead of a real build system. -mike

#83 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to David Woodhouse
Quoted 22 lines · David Woodhouse
Quoted 6 lines · Bill Gatliff

Guys:

Quoted 2 lines

If you opt to cross-compile, having to deal with those sorts of things is the price you pay.

Quoted 8 lines

If the build system derives from autoconf, then a hacked-up config.cache (or equivalent command-line args) often solves problems for me. Just give the cache the answers that it would otherwise have to get by running code on the target machine.

That's how emdebian is doing a bunch of their stuff, and I have to admit that it works pretty darned well. It's also handy for configuration management, since the cache file itself is plaintext and therefore svn/git/bzr/cvs/...-friendly.

Yeah, I was building Red Hat Linux packages for sh3 many years ago, using tricks like that. But there was always _something_ else going wrong, however much you hacked around it. And a lot of it would only turn up at runtime, not build time. I would never consider shipping a product with a large number of userspace packages cross-compiled.

Quoted 3 lines

For minimal file systems with a select handful of tools which can be tested exhaustively, it's not so bad. But for any 'full-featured' userspace, I think cross-compilation is completely insane.

There's also the middle way taken by e.g. Scratchbox of using cross-compilers and other tools from the machine the compilation is done on, but emulating a native build for the software being compiled.

This works quite good in practice.

Quoted 1 line

dwmw2

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#78 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Paul Mundt
Quoted 5 lines · Paul Mundt

Yes, that's the easy case. It's things like perl that are the corner cases, and my objection comes from the fact that people think we ought to not have the kernel depend on perl rather than just fixing the package itself. Autoconf/libtool damage is an entirely different problem :-)

At first glance, it seems like checkincludes.pl could be duplicated by egrep | uniq | wc vs. egrep | wc. Not quite sure what checkversion.pl is trying to do.

The namespace.pl script looks optional, as does export_report.pl.

So maybe we could _reduce_ dependency on perl, if there's any advantage to gain by doing so. But the kernel build machinery isn't dependent on very many other systems (just tcl, bash and gcc-core), so I don't really see the point unless you could completely eliminate perl. And I don't see how you might do *that* without dragging in a bunch of stuff to replace it, thereby increasing the number of dependencies.

Any machine beefy enough to build the kernel is more than adequate to host perl as well. So maybe the "corner case" is situations where you're trying to build the kernel on an overly-minimalist host--- perhaps one that you constructed yourself using linux-from-scratch?

Not trying to fan the flames any, of course. I'm just sayin'...

The worst for cross-building so far for me has been openssh. And even that's tolerable once you find your way around the autoconf stuff. But this would be the wrong list for that. :)

b.g.

Signature · 2 lines
Bill Gatliff
[email protected]
#85 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to David Woodhouse
Quoted 5 lines · David Woodhouse

Yeah, I was building Red Hat Linux packages for sh3 many years ago, using tricks like that. But there was always _something_ else going wrong, however much you hacked around it. And a lot of it would only turn up at runtime, not build time. I would never consider shipping a product with a large number of userspace packages cross-compiled.

I take it on a case-by-case basis. But yea, validation is definitely a pain. Especially with all the silent failures (i.e. getting endianness wrong) that the configure script creates for you.

Quoted 3 lines

For minimal file systems with a select handful of tools which can be tested exhaustively, it's not so bad. But for any 'full-featured' userspace, I think cross-compilation is completely insane.

We both agree that it'll *drive* you insane, at least. And I'm 90% with you on the rest. :)

b.g.

Signature · 2 lines
Bill Gatliff
[email protected]
#84 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Adrian Bunk
Quoted 4 lines · Adrian Bunk

There's also the middle way taken by e.g. Scratchbox of using cross-compilers and other tools from the machine the compilation is done on, but emulating a native build for the software being compiled.

I suppose. But I've never gotten Scratchbox to work for me, at all.

Whether the problem is me or Scratchbox, I don't really want to know. :)

b.g.

Signature · 2 lines
Bill Gatliff
[email protected]
#79 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Bill Gatliff
Quoted 9 lines · Bill Gatliff
Quoted 4 lines · Paul Mundt

Yes, that's the easy case. It's things like perl that are the corner cases, and my objection comes from the fact that people think we ought to not have the kernel depend on perl rather than just fixing the package itself. Autoconf/libtool damage is an entirely different problem :-)

At first glance, it seems like checkincludes.pl could be duplicated by egrep | uniq | wc vs. egrep | wc. Not quite sure what checkversion.pl is trying to do.

Quoted 8 lines

The namespace.pl script looks optional, as does export_report.pl.

So maybe we could _reduce_ dependency on perl, if there's any advantage to gain by doing so. But the kernel build machinery isn't dependent on very many other systems (just tcl, bash and gcc-core), so I don't really see the point unless you could completely eliminate perl. And I don't see how you might do *that* without dragging in a bunch of stuff to replace it, thereby increasing the number of dependencies.

the idea is to keep perl from being required to build the kernel itself. tcl is not required in this case either. if you want to use crazy languages to optional things above and beyond, then no one is going to complain (and if they do, well screw them).
-mike

#80 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Bill Gatliff
Quoted 11 lines · Bill Gatliff
Quoted 5 lines · Paul Mundt

Yes, that's the easy case. It's things like perl that are the corner cases, and my objection comes from the fact that people think we ought to not have the kernel depend on perl rather than just fixing the package itself. Autoconf/libtool damage is an entirely different problem :-)

At first glance, it seems like checkincludes.pl could be duplicated by egrep | uniq | wc vs. egrep | wc. Not quite sure what checkversion.pl is trying to do.

Quoted 8 lines

The namespace.pl script looks optional, as does export_report.pl.

So maybe we could _reduce_ dependency on perl, if there's any advantage to gain by doing so. But the kernel build machinery isn't dependent on very many other systems (just tcl, bash and gcc-core), so I don't really see the point unless you could completely eliminate perl. And I don't see how you might do *that* without dragging in a bunch of stuff to replace it, thereby increasing the number of dependencies.

All the noise about the perl dependency of the kernel build are rooted in two things:

1) That we now have a mandatory part of the build that uses perl (see kernel/Makefile)
2) That I told that I consider rewriting the core of the build system in perl

As for 1) I have seen a patch submitted once. And I do not hear many complaint either, albeit Rob Landley is a bit loud here (and he was also the one submitting the patch). That patch was not acceptable as is - and noone has updated it.

As for 2) then let see if that ever happens ;-)

Sam

#26 lore raw
In reply to Rob Landley

* Rob Landley <[email protected]> schrieb:

Hi,

Quoted 1 line

There's also qemu. You can native build under emulation.

did you ever consider that crosscompiling is not only good for some other arch, but a few more things ?

Quoted 3 lines

In addition, if you have a cross compiler but don't want to spend all your time lying to ./configure, preventing gcc from linking against the host's zlib or grabbing stuff out of /usr/include that your target hasn't got, or

#1: use a proper (sysroot'ed) toolchain
#2: fix broken configure.in's (and feed back to upstream or OSS-QM) #3: replace libtool by unitool

Quoted 1 line

trying to figure out why on EARTH the perl build decided to use x86 signal

Perl never was crosscompile-capable.
I've rewrote much of the buildscripts, but not finished yet.

Just in case that anyone's interested in it, let me know.

Quoted 2 lines

libraries are linked inside the emulator, anything that wants to look at /proc or sysinfo does it natively inside the emulator...)

Only crap sw looks at /proc at build time.
Yes, there's *much* crap sw out there :(

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#164 lore raw
In reply to Rob Landley
Quoted 8 lines · Rob Landley

Cross compiling breaks stuff, yes.

Most packages don't cross compile at all. Debian has somewhere north of 30,000 packages. Every project that does large scale cross compiling (buildroot, gentoo embedded, timesys making fedora cross compile, etc) tends to have about 200 packages that cross compile more or less easily, another 400 or so that can be made to cross compile with _lot_ of effort and a large enough rock, and then the project stalls at about that size.

The problem is: most embedded projects don't make really general-purpose fixes (instead strange things like hacking up autogenerated files), so they can't feed back to upstream.

IMHO, a huge waste of working time.

Did someone ever hear of the OSS-QM project ?

Quoted 3 lines

Some of the other build systems out there hook qemu application emulation up to the kernel's misc binary support so a ./configure that builds arm executables can run them.

WTF ?!

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#69 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Mike Frysinger
Quoted 20 lines · Mike Frysinger
Quoted 19 lines · David Woodhouse
Quoted 17 lines · Tim Bird
Quoted 8 lines · Rob Landley

However, having one or more full-time engineers devoted to debugging cross-compile issues is quite a high price to pay too. Moore's law really doesn't help that one.

I'm not saying either solution is perfect, I'm just saying the "build under emulation" approach is a viable alternative that gets more attractive as time passes, both because of ongoing development on emulators and because of Moore's law on the hardware.

I agree with much that you have said, Rob, and I understand the argument for getting the most gain from the least resources, but I have a philosophical problem with working around the cross-compilation problems instead of fixing them in the upstream packages (or in the autoconf system itself).

Once someone fixes the cross-compilation issues for a package, they usually stay fixed, if the fixes are mainlined.

Quoted 7 lines
Quoted 5 lines

I don't think that's true, unfortunately. Autoconf makes it _easy_ to do the wrong thing, and people will often introduce new problems.

If we just made people write portable code and proper Makefiles, it would be less of an issue :)

people cant even write proper *native* makefiles. mtd-utils for example ;).

What's wrong with it? I'll fix it.

josh

#91 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Paul Mundt
Quoted 2 lines · Paul Mundt

The other issue is that people that are working in this space tend to do very little beyond solving their immediate troubles.

Sad but true :(

Quoted 2 lines

Since perl was mentioned, it also makes a good example. Embedded distros have been cross-compiling perl for pretty much the last decade, yet even

Now I'm curious: where can I find a patch ?

Upstream's build scripts are really far from being cross'able.

Quoted 5 lines

You can either try to fix the packages in question, convince the package developers to rip out the parts that cause trouble for your environment, fix your own build environment to meet the needs of the packages, or whine about it on a mailing list. Empirically we already know which one of those options is going to win out. ;-)

I, personally, prefer to *solve* problems instead of trying to work around somehow. In longer terms, this worked quite good for me.

Of course, fixing requires that you find out what's the problem really is before ;-P

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#88 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Bill Gatliff
Quoted 3 lines · Bill Gatliff

If the build system derives from autoconf, then a hacked-up config.cache (or equivalent command-line args) often solves problems for me.

Only if you're working on *one specific* target for a long time. I, for example, have to support lots of different targets, so your approach does not work for me. Ah, and it's not *solving* any problem, just deferring it to some other day.

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#94 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Tim Bird
Quoted 2 lines · Tim Bird

If autoconf is the problem (and I think it is), then that's what should be fixed (see my original post).

ACK. One of the first things I did was replacing libtool and kicked off broken-by-design macros like AC_TRY_RUN. This solved at >80% of the problems for me.

Quoted 2 lines

At a minimum, it would be nice if it had more built-in detection and warning of techniques that were dangerous for cross-compilation.

Meanwhile, autoconf warns on some broken macros like AC_TRY_RUN.

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#77 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Mike Frysinger
Quoted 7 lines · Mike Frysinger
Quoted 6 lines · Paul Mundt
Quoted 3 lines · Bill Gatliff

That's how emdebian is doing a bunch of their stuff, and I have to admit that it works pretty darned well. It's also handy for configuration management, since the cache file itself is plaintext and therefore svn/git/bzr/cvs/...-friendly.

Quoted 7 lines
Quoted 4 lines

Yes, that's the easy case. It's things like perl that are the corner cases, and my objection comes from the fact that people think we ought to not have the kernel depend on perl rather than just fixing the package itself. Autoconf/libtool damage is an entirely different problem :-)

of the core packages, perl and openssl tend to be heavily damaged. openssl because it depends on perl instead of a real build system.

It's also a pity that automake doesn't work with microperl. And even for the most simple .pm you have to do perlward^Wawkward stuff like

ifeq ($(BR2_PACKAGE_AUTOMAKE),y)

        # we need to build a perl for the host just for Errno.pm
        (cd $(MICROPERL_DIR); ./Configure -de; \
         $(MAKE) CC="$(HOSTCC)"; \
         $(SHELL) ext/util/make_ext nonxs Errno MAKE="$(firstword $(MAKE))"; \
        )
endif
        (cd $(MICROPERL_DIR); chmod u+w uconfig.h; . ./uconfig.sh; \
         $(MAKE) -f Makefile.micro regen_uconfig; \
[snip rest of the misery]
#27 lore raw
In reply to Enrico Weigelt
Quoted 3 lines · In message <[email protected]> you wrote:

Perl never was crosscompile-capable.
I've rewrote much of the buildscripts, but not finished yet.

Note that Perl is included with our ELDK, and we do cross-compile it. It's not exactly trivial, but not really difficult either.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
I have a theory that it's impossible to prove anything, but  I  can't
prove it.
#92 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Enrico Weigelt
Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 3 lines

Since perl was mentioned, it also makes a good example. Embedded distros have been cross-compiling perl for pretty much the last decade, yet even

Now I'm curious: where can I find a patch ?

See for example:

http://git.denx.de/?p=eldk/build.git;a=tree;f=target_rpms/perl;h=fd830dd2e6bf86703fab84b83922eea8c10f0310;hb=3e5c010c91e17e819048937eb4105d762c7e1497

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
Nothing is easier than to denounce  the  evildoer;  nothing  is  more
difficult than to understand him.                 - Fyodor Dostoevski
#89 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Enrico Weigelt
Quoted 9 lines · Enrico Weigelt
Quoted 3 lines · Bill Gatliff

If the build system derives from autoconf, then a hacked-up config.cache (or equivalent command-line args) often solves problems for me.

Only if you're working on *one specific* target for a long time. I, for example, have to support lots of different targets, so your approach does not work for me.

I'm not exactly a one-specific-target kinda guy, either. I routinely move between MIPS, ARM, PPC and x86.

Yea, that means target-specific config.cache files. But that works for me.

Quoted 2 lines

Ah, and it's not *solving* any problem,
just deferring it to some other day.

If "solving" means helping the tool get the answer it needs, even when running in an environment/configuration it wasn't intended for, without breaking compatibility with everyone else out there still using the same tool, then I disagree.

But hey, I never said you had to do it my way. :)

b.g.

Signature · 2 lines
Bill Gatliff
[email protected]
#70 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Josh Boyer
Quoted 24 lines · Josh Boyer
Quoted 23 lines · Mike Frysinger
Quoted 22 lines · David Woodhouse
Quoted 10 lines · Tim Bird
Quoted 8 lines · Rob Landley

However, having one or more full-time engineers devoted to debugging cross-compile issues is quite a high price to pay too. Moore's law really doesn't help that one.

I'm not saying either solution is perfect, I'm just saying the "build under emulation" approach is a viable alternative that gets more attractive as time passes, both because of ongoing development on emulators and because of Moore's law on the hardware.

Quoted 7 lines

I agree with much that you have said, Rob, and I understand the argument for getting the most gain from the least resources, but I have a philosophical problem with working around the cross-compilation problems instead of fixing them in the upstream packages (or in the autoconf system itself).

Once someone fixes the cross-compilation issues for a package, they usually stay fixed, if the fixes are mainlined.

I don't think that's true, unfortunately. Autoconf makes it _easy_ to do the wrong thing, and people will often introduce new problems.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

If we just made people write portable code and proper Makefiles, it would be less of an issue :)

people cant even write proper *native* makefiles. mtd-utils for example ;).

What's wrong with it? I'll fix it.

is [email protected] not the place to post ? that's where i sent the first fix yesterday ... not that i'm subscribed since i dont have a direct interest in mtd development ...
-mike

#28 lore raw
In reply to Wolfgang Denk
Quoted 7 lines · Wolfgang Denk
Quoted 3 lines · In message <[email protected]> you wrote:

Perl never was crosscompile-capable.
I've rewrote much of the buildscripts, but not finished yet.

Note that Perl is included with our ELDK, and we do cross-compile it. It's not exactly trivial, but not really difficult either.

URL ?

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#165 lore raw
In reply to Enrico Weigelt
Quoted 4 lines · Enrico Weigelt
Quoted 2 lines · Rob Landley

Cross compiling breaks stuff, yes.

Quoted 9 lines
Quoted 2 lines

Most packages don't cross compile at all. Debian has somewhere north of 30,000 packages. Every project that does large scale cross compiling (buildroot, gentoo embedded, timesys making fedora cross compile, etc) tends to have about 200 packages that cross compile more or less easily, another 400 or so that can be made to cross compile with _lot_ of effort and a large enough rock, and then the project stalls at about that size.

The problem is: most embedded projects don't make really general-purpose
fixes (instead strange things like hacking up autogenerated files), so they can't feed back to upstream.

IMHO, a huge waste of working time.

Amen, brother. I'm fortunate in that I work for an organization that is quite good about enforcing code reviews, specifically, the QA organization is empowered to reject changes that do not have code review notes. I also have a fairly broad scope, so I'm in on code reviews for a number of open source components. At each such review, one of my criteria is whether the change is suitable for pushing back to the appropriate community. This is not necessarily a short-term way to make friends, but the long-term effects will be good both for the company and for the open source community in general.

Now, if we can only get the time to actually push all the backlogged fixes out... --
David VomLehn, [email protected]
The opinions expressed herein are likely mine, but might not be my employer's...

#166 lore raw
Quoted 11 lines · David VomLehn
Quoted 10 lines · Enrico Weigelt
Quoted 4 lines · Rob Landley

Cross compiling breaks stuff, yes.

Most packages don't cross compile at all. Debian has somewhere north of 30,000 packages. Every project that does large scale cross compiling (buildroot, gentoo embedded, timesys making fedora cross compile, etc) tends to have about 200 packages that cross compile more or less easily, another 400 or so that can be made to cross compile with _lot_ of effort and a large enough rock, and then the project stalls at about that size.

The problem is: most embedded projects don't make really general-purpose
fixes (instead strange things like hacking up autogenerated files), so they can't feed back to upstream.

Quoted 6 lines
Quoted 3 lines

IMHO, a huge waste of working time.

Amen, brother. I'm fortunate in that I work for an organization that is quite good about enforcing code reviews, specifically, the QA organization is empowered to reject changes that do not have code review notes. I also have a fairly broad scope, so I'm in on code reviews for a number of open source components. At each such review, one of my criteria is whether the change is suitable for pushing back to the appropriate community. This is not necessarily a short-term way to make friends, but the long-term effects will be good both for the company and for the open source community in general.

Now, if we can only get the time to actually push all the backlogged fixes out...

Er, is that GPL or LGPL code that you're modifying? If so, you *have* to push those code changes out (make them available to others), whether you think people will be interested or not!

Quoted 3 lines
Signature · 2 lines
David VomLehn, [email protected]
The opinions expressed herein are likely mine, but might not be my employer's...
Signature · 4 lines
James Chapman
Katalix Systems Ltd
http://www.katalix.com
Catalysts for your Embedded Linux software development
#167 lore raw
Quoted 11 lines · James Chapman
Quoted 10 lines · David VomLehn

Amen, brother. I'm fortunate in that I work for an organization that is quite good about enforcing code reviews, specifically, the QA organization is empowered to reject changes that do not have code review notes. I also have a fairly broad scope, so I'm in on code reviews for a number of open source components. At each such review, one of my criteria is whether the change is suitable for pushing back to the appropriate community. This is not necessarily a short-term way to make friends, but the long-term effects will be good both for the company and for the open source community in general.

Quoted 6 lines
Quoted 2 lines

Now, if we can only get the time to actually push all the backlogged fixes out...

Er, is that GPL or LGPL code that you're modifying? If so, you *have* to push those code changes out (make them available to others), whether you think people will be interested or not!

umm, not really. only if (1) he gives a binary to someone and (2) they ask him for the source. if he doesnt distribute or no one asks, he doesnt have to do squat.
-mike

#168 lore raw
Quoted 7 lines · Mike Frysinger
Quoted 3 lines

Er, is that GPL or LGPL code that you're modifying? If so, you *have* to push those code changes out (make them available to others), whether you think people will be interested or not!

umm, not really. only if (1) he gives a binary to someone and (2) they ask him for the source. if he doesnt distribute or no one asks, he doesnt have to do squat.

This is closer to correct, but missing some important details.

Start the GPL compliance tutorial/flameware in 3, 2, 1...

Luckily this in only on the linux-embedded list. If it were on LKML the fun would really begin. :-)

-- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum Senior Staff Engineer, Sony Corporation of America
=============================

#169 lore raw
Quoted 5 lines · Tim Bird
Quoted 4 lines · Mike Frysinger
Quoted 3 lines

Er, is that GPL or LGPL code that you're modifying? If so, you *have* to push those code changes out (make them available to others), whether you think people will be interested or not!

Quoted 7 lines
Quoted 3 lines

umm, not really. only if (1) he gives a binary to someone and (2) they ask him for the source. if he doesnt distribute or no one asks, he doesnt have to do squat.

This is closer to correct, but missing some important details.

Start the GPL compliance tutorial/flameware in 3, 2, 1...

yeah, i really dont think licensing things belong here. sorry for following up.

how about this policy: if you want to make a statement, go pay a lawyer. but that statement still shouldnt be made here ;). -mike

#173 lore raw
In reply to Mike Frysinger
Quoted 15 lines · Mike Frysinger
Quoted 14 lines · James Chapman
Quoted 12 lines · David VomLehn

Amen, brother. I'm fortunate in that I work for an organization that is quite good about enforcing code reviews, specifically, the QA organization is empowered to reject changes that do not have code review notes. I also have a fairly broad scope, so I'm in on code reviews for a number of open source components. At each such review, one of my criteria is whether the change is suitable for pushing back to the appropriate community. This is not necessarily a short-term way to make friends, but the long-term effects will be good both for the company and for the open source community in general.

Now, if we can only get the time to actually push all the backlogged fixes out...

Quoted 8 lines
Quoted 3 lines

Er, is that GPL or LGPL code that you're modifying? If so, you *have* to push those code changes out (make them available to others), whether you think people will be interested or not!

umm, not really. only if (1) he gives a binary to someone and (2) they ask him for the source. if he doesnt distribute or no one asks, he doesnt have to do squat.
-mike

And I'm just betting that when he said "push ... fixes ... out" he meant "work to get them incorporated back upstream", not just make them available to requesters.

Most vendors these days have finally gotten the clue that sources/changes have to be made available to downstream requesters, but far fewer are sufficiently self-enlightened to figure out that changes need to be accepted upstream for them to keep flowing back. And to make that happen, vendors have to take on substantially higher overhead to win acceptance of patches/changes upstream, an undertaking often sadly fraught with hassle, uncertainty, and even peril. So they mostly don't bother. To their (and their customers, and our) long-term detriment.

And Cisco has probably learned by now (and by sad experience) to do the Right (tm) thing.

...jfree

#47 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Robert P. J. Day
Quoted 5 lines · On Thursday 12 June 2008 11:12:13 Robert P. J. Day wrote:
Quoted 4 lines · Mike Frysinger
Quoted 2 lines · David Woodhouse

If we just made people write portable code and proper Makefiles, it would be less of an issue :)

Quoted 8 lines
Quoted 2 lines

people cant even write proper *native* makefiles. mtd-utils for example ;).

meooowww! :-) but at the risk of dragging this even further off-topic, i am *constantly* asked by people how to set up makefiles for their software project, and what would be nice is a small collection of examples of a makefile (or makefiles) done *right*. as in,

Make doesn't scale.

99% of the builds in the open source world are "make all", and most of the smaller projects build natively on modern dual processor 2ghz laptops in under 10 seconds anyway.

The larger projects with significant build times usually find that make doesn't suit their needs, so that they write some other build system. Sometimes they do it on top of make, such as the kernel's kbuild. Sometimes they use another language like apache's ANT. Sometimes they roll their own in C (anybody remember X11's imake?) KDE switched to cmake:
http://lwn.net/Articles/188693/

Current compilers have a "build at once" mode where they suck the whole project in and run the optimizer on it at once, resulting in noticeably smaller and faster output at the expense of needing buckets of memory to hold all the source code and intermediate structures in memory at once. The main roadblock to making use of this? Ripping out the existing makefiles and replacing them with a very small shell script that does something similar to "gcc *.c".

The first question you should be asking when doing a new build system from scratch is probably "should I really be using make"?

Quoted 1 line

properly recursive,

Recursive make considered harmful:
http://aegis.sourceforge.net/auug97.pdf

How is needing to call make recursively _not_ just another way of sayng "the dependency checking make does, which was the central idea behind its design, is a lost cause and we need to jettison it to do builds"?

I just did a "make distclean" on a qemu tree I had lying around. On my 1.7 ghz 64 bit laptop, it took 9.2 seconds to figure out it had nothing to do, just because it had to recurse into so many subdirectories to do it.

Quoted 2 lines

supports cross-compiling without having to
remove your left nad, etc, etc.

Can of worms. Answering that question would be a longer post than the rest of this combined, but I've pointed out that I don't think going there is worth it anymore for most packages.

Quoted 3 lines

so ... would anyone like to recommend a software package or two somewhere whose makefile(s) is/are, ITHO, done well? that i/we could just point at and say, "do it like that!" anyone? anyone? bueller?

A software package with makefiles done well is like asking for a _good_ example of cobol programming.

The one and only advantage make has right now is that it's ubiquitous. So was "ed", which dates from the same general timeframe. That's not an endorsement.

Rob

Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.
#48 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

Quoted 3 lines · Rob Landley

I just did a "make distclean" on a qemu tree I had lying around. On my 1.7 ghz 64 bit laptop, it took 9.2 seconds to figure out it had nothing to do, just because it had to recurse into so many subdirectories to do it.

Which is precisely why recursive makes are considered bad.

b.g.

Signature · 2 lines
Bill Gatliff
[email protected]
#100 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer (s)...)

In reply to Tim Bird
Quoted 8 lines · On Thursday 12 June 2008 11:23:19 Tim Bird wrote:
Quoted 2 lines · David Woodhouse

I don't think that's true, unfortunately. Autoconf makes it _easy_ to do the wrong thing, and people will often introduce new problems.

If autoconf is the problem (and I think it is), then that's what should be fixed (see my original post). At a minimum, it would be nice if it had more built-in detection and warning of techniques that were dangerous for cross-compilation.

If autoconf is currently too complicated for people to use correctly, complicating it more probably isn't the answer. (Down that path lies C++.)

Quoted 11 lines
Quoted 6 lines · Paul Mundt

You can
either try to fix the packages in question, convince the package developers to rip out the parts that cause trouble for your environment, fix your own build environment to meet the needs of the packages, or whine about it on a mailing list. Empirically we already know which one of those options is going to win out. ;-)

LOL. Well, at least Rob has put his money where his mouth is (so to speak) with Firmware Linux. The chance that I'll do anything but whine about autoconf is slim indeed... I'll shut up now!

Um, actually Eric Raymond and I have had long talks about this, and if we're ever in the same state for more than 3 days we may finally get to do a serious research project about the successors to ./configure and make.

He recently converted Battle for Wesnoth to use something called "scons" as its build system, and apparently the resulting make stuff was 1/17th the size of the original. You'd have to ask him for details, though...

Rob

Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.
#101 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

Quoted 4 lines · Rob Landley

He recently converted Battle for Wesnoth to use something called "scons" as its build system, and apparently the resulting make stuff was 1/17th the size of the original. You'd have to ask him for details, though...

scons is definitely wicked cool. every time i start a new project, i am seriously tempted to give it a shot.

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
Have classroom, will lecture.

http://crashcourse.ca Waterloo, Ontario, CANADA
========================================================================

#102 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Rob Landley
Quoted 3 lines · Rob Landley

He recently converted Battle for Wesnoth to use something called "scons" as its build system, and apparently the resulting make stuff was 1/17th the size of the original.

probably because scons has ~1/17th the functionality of autotools. seriously, it's terrible. funny you should mention it in a thread about cross-compiling seeing as how it doesnt have a chance of supporting it (has hard enough time supporting native builds). -mike

#130 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Rob Landley
Quoted 4 lines

Um, actually Eric Raymond and I have had long talks about this, and if we're ever in the same state for more than 3 days we may finally get to do a serious research project about the successors to ./configure and make.

Tom has started a nice project which he named: quagmire.
See: http://code.google.com/p/quagmire/

From the website:
quagmire is intended to replace automake and libtool. Unlike these tools it requires GNU make and is written solely using GNU make features -- no preprocessing is required.

Sam

#103 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Mike Frysinger
Quoted 3 lines · On Friday 13 June 2008 03:29:52 Mike Frysinger wrote:
Quoted 2 lines · Rob Landley

He recently converted Battle for Wesnoth to use something called "scons" as its build system,

Battle of Wesnoth is currently converted to both Scons and CMake, and in the end they will decide about the winner.
(since Eric is good at arguing I guess it will be scons).

Quoted 5 lines
Quoted 2 lines

and apparently the resulting make stuff was 1/17th the size of the original.

probably because scons has ~1/17th the functionality of autotools. seriously, it's terrible.

I saw the presentation about scons by the main scons developer at FOSDEM this year and it felt more like a library which you can use to create a buildsystem, not like a ready-to-use buildsystem itself.

Alex

Signature · 12 lines
TU-Kaiserslautern
Lehrstuhl für Echtzeitsysteme
Postfach 3049
D-67653 Kaiserslautern
Germany

Tel: +49 (0)631 205 3644
Fax: +49 (0)631 205 4199
--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#132 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to David Woodhouse
Quoted 17 lines · On Thursday 12 June 2008 17:50:31 you wrote:
Quoted 16 lines · Tim Bird
Quoted 8 lines · Rob Landley

However, having one or more full-time engineers devoted to debugging cross-compile issues is quite a high price to pay too. Moore's law really doesn't help that one.

I'm not saying either solution is perfect, I'm just saying the "build under emulation" approach is a viable alternative that gets more attractive as time passes, both because of ongoing development on emulators and because of Moore's law on the hardware.

I agree with much that you have said, Rob, and I understand the argument for getting the most gain from the least resources, but I have a philosophical problem with working around the cross-compilation problems instead of fixing them in the upstream packages (or in the autoconf system itself).

Quoted 8 lines
Quoted 2 lines

Once someone fixes the cross-compilation issues for a package, they usually stay fixed, if the fixes are mainlined.

I don't think that's true, unfortunately. Autoconf makes it _easy_ to do the wrong thing, and people will often introduce new problems.

If we just made people write portable code and proper Makefiles, it would be less of an issue :)

Well, IMO this makes it sound too easy.
If you write portable software, you have to do platform checks. Basically they can be done by
-checking for the existence of files
-checking if something builds
-checking the output of running something you just built

The last one is the problem for cross compiling.
Example: detecting the size of ints

Easy way:

...
printf("%d\n", sizeof(long));
...

and then building and running that code and checking the output. Converting checks like this, which seem perfectly fine for native builds, to something which doesn't need to run an executable is not always trivial (but the way to go if you want to make your package cross-compilable).
(and yes, we converted this test in cmake 2.6 to a build-only test)

Alex

#49 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Rob Landley
Quoted 21 lines · On Friday 13 June 2008 02:25:34 you wrote:
Quoted 5 lines · On Thursday 12 June 2008 11:12:13 Robert P. J. Day wrote:
Quoted 4 lines · Mike Frysinger
Quoted 2 lines · David Woodhouse

If we just made people write portable code and proper Makefiles, it would be less of an issue :)

Quoted 8 lines
Quoted 2 lines

people cant even write proper *native* makefiles. mtd-utils for example ;).

meooowww! :-) but at the risk of dragging this even further off-topic, i am *constantly* asked by people how to set up makefiles for their software project, and what would be nice is a small collection of examples of a makefile (or makefiles) done *right*. as in,

Make doesn't scale.

99% of the builds in the open source world are "make all", and most of the smaller projects build natively on modern dual processor 2ghz laptops in under 10 seconds anyway.

Quoted 6 lines

The larger projects with significant build times usually find that make doesn't suit their needs, so that they write some other build system. Sometimes they do it on top of make, such as the kernel's kbuild. Sometimes they use another language like apache's ANT. Sometimes they roll their own in C (anybody remember X11's imake?) KDE switched to cmake:
http://lwn.net/Articles/188693/

CMake can create Makefiles on all platforms (including complete dependencies, i.e. if you build an app which depends even indirectly on some lib then that lib will be rebuilt before), additionally XCode projects and MSVC projects (and Eclipse, KDevelop3 and CodeBlocks projects, but these use makefiles too).
So, we at KDE are still using make mainly, I don't really see how it doesn't scale (at least it scales much better than scons).

Quoted 7 lines

Current compilers have a "build at once" mode where they suck the whole project in and run the optimizer on it at once, resulting in noticeably smaller and faster output at the expense of needing buckets of memory to hold all the source code and intermediate structures in memory at once. The main roadblock to making use of this? Ripping out the existing makefiles and replacing them with a very small shell script that does something similar to "gcc *.c".

We support that in KDE since a long time, with KDE 2.x to 3.x this "include-all" file was created via autotools, now with KDE 4 it's created by cmake. It makes compilation of the whole project faster, certainly not if you are building only a few files.
So, there is not really a roadblock to this.

Quoted 8 lines

The first question you should be asking when doing a new build system from scratch is probably "should I really be using make"?

Quoted 1 line

properly recursive,

Recursive make considered harmful:
http://aegis.sourceforge.net/auug97.pdf

Quoted 7 lines

How is needing to call make recursively _not_ just another way of sayng "the dependency checking make does, which was the central idea behind its design, is a lost cause and we need to jettison it to do builds"?

I just did a "make distclean" on a qemu tree I had lying around. On my 1.7 ghz 64 bit laptop, it took 9.2 seconds to figure out it had nothing to do, just because it had to recurse into so many subdirectories to do it.

I'm quite sure for a sufficiently large project this will always be the case. There are thousands of files which have to be checked whether they are up-to-date, so this takes some time.

Quoted 10 lines
Quoted 2 lines

supports cross-compiling without having to
remove your left nad, etc, etc.

Can of worms. Answering that question would be a longer post than the rest of this combined, but I've pointed out that I don't think going there is worth it anymore for most packages.

Quoted 3 lines

so ... would anyone like to recommend a software package or two somewhere whose makefile(s) is/are, ITHO, done well? that i/we could just point at and say, "do it like that!" anyone? anyone? bueller?

Use CMake >= 2.6.0 (http://www.cmake.org).
It supports cross compiling (... and of course everything else you might ever need ;-)
In general, cross compiling is not hard. You just have to call the cross toolchain, give it the correct parameters, search files in the right location and ... make sure you don't test stuff by running programs. Basically only the last one is problematic (but IMO still less problematic than running a virtual system on the host just to build something).

How does cmake support that for cross compiling ?
If it detects a try_run() (which is the command for building a test executable and then running it) in cross compiling mode (i.e. when it was told what the target platform is instead of just assuming it's the same as the build host), then it
-issues a warning
-stores the created executable in a place so the developer can find it -running some existing executable and checking its output -creates a file where the developer can enter the results which running the executable on the target host would have brought (includes comments where that command was found, the arguments, etc.,). The developer can then run the test executable manually on the target and enter the results. This seems to be similar to the config.cache somebody mentioned for debian.

So really the hard part is getting rid of running stuff to check the platform. If the project does that, all the build tool can do is support the developer in finding these spots and caring for them.

Did I mention that getting started with cmake is easy ?
A file CMakeLists.txt containing the following command is all you need for a "hello world":
add_executable(hello main.c)

Alex

#51 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Rob Landley
Quoted 1 line · Rob Landley

Make doesn't scale.

Make scales just fine. The only real problem with make is that it's a complete pain to debug.

Signature · 1 line
dwmw2
#133 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Alexander Neundorf
Quoted 18 lines · Alexander Neundorf
Quoted 17 lines · On Thursday 12 June 2008 17:50:31 you wrote:
Quoted 16 lines · Tim Bird
Quoted 8 lines · Rob Landley

However, having one or more full-time engineers devoted to debugging cross-compile issues is quite a high price to pay too. Moore's law really doesn't help that one.

I'm not saying either solution is perfect, I'm just saying the "build under emulation" approach is a viable alternative that gets more attractive as time passes, both because of ongoing development on emulators and because of Moore's law on the hardware.

I agree with much that you have said, Rob, and I understand the argument for getting the most gain from the least resources, but I have a philosophical problem with working around the cross-compilation problems instead of fixing them in the upstream packages (or in the autoconf system itself).

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

Once someone fixes the cross-compilation issues for a package, they usually stay fixed, if the fixes are mainlined.

I don't think that's true, unfortunately. Autoconf makes it _easy_ to do the wrong thing, and people will often introduce new problems.

If we just made people write portable code and proper Makefiles, it would be less of an issue :)

ACK. And proper build time tools.

Quoted 4 lines

Well, IMO this makes it sound too easy.
If you write portable software, you have to do platform checks. Basically they can be done by
-checking for the existence of files

That can be done as - sooner or later - one must install the compiled stuff anyway. So one has root directory somewhere and one can tell the tools.

Review

Quoted 2 lines
(quoted diff) +0 -2
-checking if something builds
-checking the output of running something you just built

And the above are not really a big problem - embedded people usually know such details and can tell the autoconf tools.
Even worse is (or at least were) tools like pkg_config and libtool, which generate directories to the build time library.

The only simple solution so far (without diving into the implementation and searching for root causes) were AFAICS:
- do not use libtool for linking (as the link line as such without libtool works as expected)
- rewrite generated pkg_config files after generation.
Yes, that's pretty ugly.
But perhaps I was just too dumb to find the correct solutions.

Quoted 2 lines

The last one is the problem for cross compiling.
Example: detecting the size of ints

Why on earth does someone need this explicitly during the build? If you have portable software, all of that should be hidden in the code and use "sizeof(int)".

IMHO the code (or whatever piece uses it) should be fixed and the build time stuff removed.

Bernd

Signature · 3 lines
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services
#170 lore raw
In reply to Mike Frysinger
Quoted 10 lines · Mike Frysinger
Quoted 9 lines · Tim Bird
Quoted 6 lines · Mike Frysinger
Quoted 3 lines

Er, is that GPL or LGPL code that you're modifying? If so, you *have* to push those code changes out (make them available to others), whether you think people will be interested or not!

umm, not really. only if (1) he gives a binary to someone and (2) they ask him for the source. if he doesnt distribute or no one asks, he doesnt have to do squat.

This is closer to correct, but missing some important details.

Quoted 7 lines
Quoted 1 line

Start the GPL compliance tutorial/flameware in 3, 2, 1...

yeah, i really dont think licensing things belong here. sorry for following up.

how about this policy: if you want to make a statement, go pay a lawyer. but that statement still shouldnt be made here ;). -mike

Sorry, I didn't mean to provoke a GPL flame war. The point I was trying to make (badly as it turns out) is that if a company really wants to see its changes taken upstream, it could simply publish the work on its website and let each relevant community know that it's there. A diff of the changes would be ideal. This is above and beyond what they have to do under GPL terms of course. There's no need for a company to filter out changes that it thinks others won't be interested in.

Signature · 4 lines
James Chapman
Katalix Systems Ltd
http://www.katalix.com
Catalysts for your Embedded Linux software development
#60 lore raw

Re: cross-compiling alternatives

In reply to Rob Landley
Quoted 17 lines · Rob Landley
Quoted 5 lines · On Thursday 12 June 2008 11:12:13 Robert P. J. Day wrote:
Quoted 4 lines · Mike Frysinger
Quoted 2 lines · David Woodhouse

If we just made people write portable code and proper Makefiles, it would be less of an issue :)

Quoted 8 lines
Quoted 2 lines

people cant even write proper *native* makefiles. mtd-utils for example ;).

meooowww! :-) but at the risk of dragging this even further off-topic, i am *constantly* asked by people how to set up makefiles for their software project, and what would be nice is a small collection of examples of a makefile (or makefiles) done *right*. as in,

Make doesn't scale.

Quoted 8 lines

99% of the builds in the open source world are "make all", and most of the smaller projects build natively on modern dual processor 2ghz laptops in under 10 seconds anyway.

The larger projects with significant build times usually find that make doesn't suit their needs, so that they write some other build system. Sometimes they do it on top of make, such as the kernel's kbuild. Sometimes they use another language like apache's ANT. Sometimes they roll their own

"ant" is also only "make reimplemented in Java" (or did I miss something). I see no win here.

Quoted 1 line

in C (anybody remember X11's imake?) KDE switched to cmake:

That generated "only" a Makefile IIRC.

[...]

Quoted 8 lines

Current compilers have a "build at once" mode where they suck the whole project in and run the optimizer on it at once, resulting in noticeably smaller and faster output at the expense of needing buckets of memory to hold all the source code and intermediate structures in memory at once. The main roadblock to making use of this? Ripping out the existing makefiles and replacing them with a very small shell script that does something similar to "gcc *.c".

Quoted 7 lines

The first question you should be asking when doing a new build system from scratch is probably "should I really be using make"?

Quoted 1 line

properly recursive,

Recursive make considered harmful:
http://aegis.sourceforge.net/auug97.pdf

ACK.

Quoted 3 lines

How is needing to call make recursively _not_ just another way of sayng "the dependency checking make does, which was the central idea behind its design, is a lost cause and we need to jettison it to do builds"?

The problem is that build systems have (at least) two layers:
- the lower are the usual apps and libs and kernel ... bringing their working Makefile's with them.
- the upper layer needs to build the kernel, libs and apps. This needs usually a defined sequence and set of consistent parameters.
But the lower layer doesn't "export" it's local available rule base so the make (or shell script) on the upper layer can't use it and one must therefore make -C $tooldir - even if there is absolutely nothing to do.
Of course the upper layer may remember if an lib/app has been build to avoid 60% of all "obviously" useless make -C calls. But that doesn't solve any problem really.

Quoted 3 lines

I just did a "make distclean" on a qemu tree I had lying around. On my 1.7 ghz 64 bit laptop, it took 9.2 seconds to figure out it had nothing to do, just because it had to recurse into so many subdirectories to do it.

"Recursive make considered harmful"
Or you need more RAM and faster disks;-)

Bernd

Signature · 3 lines
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services
#171 lore raw
In reply to James Chapman
Quoted 18 lines · James Chapman
Quoted 17 lines · Mike Frysinger
Quoted 6 lines · Tim Bird
Quoted 5 lines · Mike Frysinger
Quoted 5 lines

Er, is that GPL or LGPL code that you're modifying? If so, you *have* to
push those code changes out (make them available to others), whether you
think people will be interested or not!

Quoted 6 lines
Quoted 3 lines

umm, not really. only if (1) he gives a binary to someone and (2) they ask him for the source. if he doesnt distribute or no one asks, he doesnt have to do squat.

This is closer to correct, but missing some important details.

Start the GPL compliance tutorial/flameware in 3, 2, 1...

yeah, i really dont think licensing things belong here. sorry for following up.

Quoted 8 lines
Quoted 3 lines

how about this policy: if you want to make a statement, go pay a lawyer. but that statement still shouldnt be made here ;). -mike

Sorry, I didn't mean to provoke a GPL flame war. The point I was trying to make (badly as it turns out) is that if a company really wants to see its changes taken upstream, it could simply publish the work on its website and let each relevant community know that it's there.

Isn't this a lot of the problem with the way embedded companies and developers interact with upstream.

In some cases it is in the embedded developers interests to see their code adopted upstream (i.e. so they don't have to maintain it).

Just tossing some code over the wall will, in almost all circumstances, result in the code being ignored.

Quoted 4 lines

A diff of
the changes would be ideal. This is above and beyond what they have to do under GPL terms of course. There's no need for a company to filter out changes that it thinks others won't be interested in.

This is a legal concern, not a practical one. All companies *should* comply with the law. Really it is more useful to convince people that it is in their own self-interest to do more than this.

Signature · 4 lines
Daniel Thompson (STMicroelectronics) <[email protected]>
1000 Aztec West, Almondsbury, Bristol, BS32 4SQ. 01454 462659

If a car is a horseless carriage then is a motorcycle a horseless horse?
#134 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Bernd Petrovitsch
Quoted 1 line · On Friday 13 June 2008 10:38:36 you wrote:

On Fre, 2008-06-13 at 08:43 +0200, Alexander Neundorf wrote:

...

Quoted 8 lines
Quoted 4 lines

Well, IMO this makes it sound too easy.
If you write portable software, you have to do platform checks. Basically they can be done by
-checking for the existence of files

That can be done as - sooner or later - one must install the compiled stuff anyway. So one has root directory somewhere and one can tell the tools.

Yes.

Quoted 4 lines

Review

Quoted 2 lines
(quoted diff) +0 -2
-checking if something builds
-checking the output of running something you just built

And the above are not really a big problem -

"checking if something builds" is no problem, this just works. Running something is a problem, as in "it doesn't just work" (...because you cannot run it).

Quoted 1 line

embedded people usually know such details and can tell the autoconf tools.

Basically yes. But if you have a big number of packages (or a huge package) which you didn't write yourself, there will be tests which run executables. Figuring out what all the tests are supposed to test in a complex unknown software project is not trivial.

Quoted 2 lines

Even worse is (or at least were) tools like pkg_config and libtool, which generate directories to the build time library.

What do you mean with "generate directories" ? RPATH ?

Quoted 4 lines

The only simple solution so far (without diving into the implementation and searching for root causes) were AFAICS:
- do not use libtool for linking (as the link line as such without libtool works as expected)

Yes, libtool sucks, it's the wrong solution to the problem. (and CMake doesn't use it).

Quoted 3 lines

- rewrite generated pkg_config files after generation. Yes, that's pretty ugly.
But perhaps I was just too dumb to find the correct solutions.

Can you please explain ? How do the generated pkg_config files look like ? Ahh, you mean they contain e.g -L/my/build/host/target/environment/opt/foo/lib instead of just -L/opt/foo/lib ?

Quoted 6 lines
Quoted 2 lines

The last one is the problem for cross compiling.
Example: detecting the size of ints

Why on earth does someone need this explicitly during the build? If you have portable software, all of that should be hidden in the code and use "sizeof(int)".

From the "developer of a buildsystem" POV: there will be users who will need it.
But this was not the point. My point was: testing something by running an executable can be _a lot_ easier than testing the same without running something.

Alex

#61 lore raw

Re: cross-compiling alternatives

In reply to Bernd Petrovitsch
Quoted 1 line · On Friday 13 June 2008 10:50:28 you wrote:

On Don, 2008-06-12 at 19:25 -0500, Rob Landley wrote:

...

Quoted 3 lines
Quoted 1 line

in C (anybody remember X11's imake?) KDE switched to cmake:

That generated "only" a Makefile IIRC.

Yes, cmake doesn't actually build the stuff itself, it generates input files for the actual build tool you want to use.
For KDE4 all buildtools supported by cmake are working: the various makes, XCode, MSVC projects.

Alex

#135 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Alexander Neundorf
Quoted 6 lines · Alexander Neundorf
Quoted 3 lines

Why on earth does someone need this explicitly during the build? If you have portable software, all of that should be hidden in the code and use "sizeof(int)".

From the "developer of a buildsystem" POV: there will be users who will need it.

I think that epitomises what's wrong with autoconf. Sometimes, the best thing to do is tell your users that they _don't_ need whatever it is they're asking you for.

Signature · 1 line
dwmw2
#136 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

Quoted 9 lines · On Friday 13 June 2008 11:12:00 you wrote:
Quoted 6 lines · Alexander Neundorf
Quoted 3 lines

Why on earth does someone need this explicitly during the build? If you have portable software, all of that should be hidden in the code and use "sizeof(int)".

From the "developer of a buildsystem" POV: there will be users who will need it.

I think that epitomises what's wrong with autoconf. Sometimes, the best

Actually I think autoconf itself is not that bad. What is bad is "autotools", i.e. that you get a combination of several tools which have to work together, all huge shell scripts, all using different syntax, etc.

Quoted 2 lines

thing to do is tell your users that they _don't_ need whatever it is they're asking you for.

We agree that if possible, tests which run something should be avoided. But seriously, sometimes this is really very hard.
I don't dare to say impossible, but I'm tempted.
E.g. in python there are tests which call functions and check their result to see if we are currently on a platform where that function is broken (I think there was such a test for poll() and some other functions).

Alex

#145 lore raw

Re: cross-compiling alternatives

In reply to Alexander Neundorf
Quoted 14 lines · Alexander Neundorf
Quoted 1 line · On Friday 13 June 2008 10:38:36 you wrote:

On Fre, 2008-06-13 at 08:43 +0200, Alexander Neundorf wrote:

...

Quoted 8 lines
Quoted 4 lines

Well, IMO this makes it sound too easy.
If you write portable software, you have to do platform checks. Basically they can be done by
-checking for the existence of files

That can be done as - sooner or later - one must install the compiled stuff anyway. So one has root directory somewhere and one can tell the tools.

Yes.

Quoted 8 lines
Quoted 4 lines

Review

Quoted 2 lines
(quoted diff) +0 -2
-checking if something builds
-checking the output of running something you just built

And the above are not really a big problem -

"checking if something builds" is no problem, this just works. Running something is a problem, as in "it doesn't just work" (...because you cannot run it).

ACK. AC_TRY_RUN() must die completely.

Quoted 6 lines
Quoted 1 line

embedded people usually know such details and can tell the autoconf tools.

Basically yes. But if you have a big number of packages (or a huge package) which you didn't write yourself, there will be tests which run executables. Figuring out what all the tests are supposed to test in a complex unknown software project is not trivial.

Yes, you get used to find the relevant lines in config.log and similar with grep and similar tools;-)
But most embedded projects haven't that much number of "large tools" - mainly because the space is limited.

Quoted 4 lines
Quoted 2 lines

Even worse is (or at least were) tools like pkg_config and libtool, which generate directories to the build time library.

What do you mean with "generate directories" ? RPATH ?

pkg-config generated (and generates? - I didn't check recently) references to libraries including the full absolute path (which is the one at build time. And at run-time there is usually
no /home/bernd/src/... or where some build may just run).

[...]

Quoted 7 lines
Quoted 3 lines

- rewrite generated pkg_config files after generation. Yes, that's pretty ugly.
But perhaps I was just too dumb to find the correct solutions.

Can you please explain ? How do the generated pkg_config files look like ? Ahh, you mean they contain e.g -L/my/build/host/target/environment/opt/foo/lib instead of just -L/opt/foo/lib ?

Yes. And even worse the compiled lib "foo" had explicit dependencies (on lib "bar") on "/my/build/host/target/environment/opt/bar/lib/libbar.so.1.2.3.4". And that is not trivially overridable at run-time AFAIK so that ld-linux finds "/opt/bar/lib/libbar.so.1.2.3.4" instead.
For real world names: glib is pretty commonly used by other libs. Voila, an indirect dependency.

And BTW pkg-config didn't support the concept of a "DESTDIR" variable (and I don't care about the name of that variable).

Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

The last one is the problem for cross compiling.
Example: detecting the size of ints

Why on earth does someone need this explicitly during the build? If you have portable software, all of that should be hidden in the code and use "sizeof(int)".

From the "developer of a buildsystem" POV: there will be users who will need it.

If there is at least one valid technical reason: Yes.
If the only reasons are "we had it since 10 years with the old system" or "we don't want to fix the code because it takes us too much time":
well, tough decision.

Quoted 3 lines

But this was not the point. My point was: testing something by running an executable can be _a lot_ easier than testing the same without running something.

Of course. But *that's* in general possible for cross-compiling. And having a 100% binary compatible qemu installation for every ARM and MIPS core out there is IMHO also not feasible.

Actually the size of ints (or any other type) can be easily deduced without running a (for the target) compiled binary:
- compile the binary (for the target) with an initialized variable with that value.
- use cross nm (or a similar tool) to read it from there.

Bernd

Signature · 3 lines
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services
#67 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Robert P. J. Day
Quoted 5 lines · Robert P. J. Day
Quoted 4 lines · Mike Frysinger
Quoted 2 lines · David Woodhouse

If we just made people write portable code and proper Makefiles, it would be less of an issue :)

Quoted 8 lines
Quoted 2 lines

people cant even write proper *native* makefiles. mtd-utils for example ;).

meooowww! :-) but at the risk of dragging this even further off-topic, i am *constantly* asked by people how to set up makefiles for their software project, and what would be nice is a small collection of examples of a makefile (or makefiles) done *right*. as in, properly recursive, supports cross-compiling without having to

      ^^^^^^^^^^^^^^^^^^
      Ugh?
Quoted 5 lines

remove your left nad, etc, etc.

so ... would anyone like to recommend a software package or two somewhere whose makefile(s) is/are, ITHO, done well? that i/we could just point at and say, "do it like that!" anyone? anyone? bueller?

The kernel, except that it's still recursive?

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   [email protected]
Internet: http://www.sony-europe.com/

Sony Technology and Software Centre Europe
A division of Sony Service Centre (Europe) N.V. Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium VAT BE 0413.825.160 · RPR Brussels
Fortis 293-0376800-10 GEBA-BE-BB

#86 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to David Woodhouse
Quoted 19 lines · David Woodhouse
Quoted 11 lines · Bill Gatliff
Quoted 2 lines

If you opt to cross-compile, having to deal with those sorts of things is the price you pay.

If the build system derives from autoconf, then a hacked-up config.cache (or equivalent command-line args) often solves problems for me. Just give the cache the answers that it would otherwise have to get by running code on the target machine.

That's how emdebian is doing a bunch of their stuff, and I have to admit that it works pretty darned well. It's also handy for configuration management, since the cache file itself is plaintext and therefore svn/git/bzr/cvs/...-friendly.

Yeah, I was building Red Hat Linux packages for sh3 many years ago, using tricks like that. But there was always _something_ else going wrong, however much you hacked around it. And a lot of it would only turn up at runtime, not build time. I would never consider shipping a product with a large number of userspace packages cross-compiled.

Quoted 3 lines

For minimal file systems with a select handful of tools which can be tested exhaustively, it's not so bad. But for any 'full-featured' userspace, I think cross-compilation is completely insane.

So, how does OpenWRT manage to survive?

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   [email protected]
Internet: http://www.sony-europe.com/

Sony Technology and Software Centre Europe
A division of Sony Service Centre (Europe) N.V. Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium VAT BE 0413.825.160 · RPR Brussels
Fortis 293-0376800-10 GEBA-BE-BB

#87 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

Quoted 5 lines · Geert Uytterhoeven
Quoted 3 lines

For minimal file systems with a select handful of tools which can be tested exhaustively, it's not so bad. But for any 'full-featured' userspace, I think cross-compilation is completely insane.

So, how does OpenWRT manage to survive?

I don't consider that a 'full-featured' userspace.

Or particularly sane, for that matter :)

Signature · 1 line
dwmw2
#68 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Robert P. J. Day

On Thu, Jun 12, 2008 at 6:12 PM, Robert P. J. Day <[email protected]> wrote:
...

Quoted 6 lines

meooowww! :-) but at the risk of dragging this even further off-topic, i am *constantly* asked by people how to set up makefiles for their software project, and what would be nice is a small collection of examples of a makefile (or makefiles) done *right*. as in, properly recursive, supports cross-compiling without having to remove your left nad, etc, etc.

...

Please read the essay "Recursive Make Considered Harmful"
(http://miller.emu.id.au/pmiller/books/rmch/).

Bart.

#146 lore raw

Re: cross-compiling alternatives

In reply to Bernd Petrovitsch
Quoted 1 line · On Friday 13 June 2008 12:03:53 you wrote:

On Fre, 2008-06-13 at 11:06 +0200, Alexander Neundorf wrote:

...

Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

- rewrite generated pkg_config files after generation. Yes, that's pretty ugly.
But perhaps I was just too dumb to find the correct solutions.

Quoted 8 lines

Review

Quoted 4 lines

Can you please explain ? How do the generated pkg_config files look like ? Ahh, you mean they contain e.g

(quoted diff) +0 -2
-L/my/build/host/target/environment/opt/foo/lib instead of just
-L/opt/foo/lib ?

Yes. And even worse the compiled lib "foo" had explicit dependencies (on lib "bar") on "/my/build/host/target/environment/opt/bar/lib/libbar.so.1.2.3.4". And

You mean the RPATH in the installed executable was wrong ?

Quoted 1 line

that is not trivially overridable at run-time AFAIK so that ld-linux

If RUNPATH is available in the binary (exists since a few years, so it should be in your toolchain), then RPATH is ignored. RUNPATH can be overridden using LD_LIBRARY_PATH. It can be enabled with the linker flag --enable-new-dtags I think.
If there is RPATH but not RUNPATH, then it can't be overridden. But still if it doesn't find the library in that place, it will continue searching in the other directories, e.g. LD_LIBRARY_PATH.

There is also a tool "chrpath", which you can use to change the RPATH entry in an existing executable.
It's a bit hard to find, you can get it e.g. from an older revision of kdesvn:
http://websvn.kde.org/trunk/kdesupport/chrpath/?pathrev=808076
(it was removed again in revision 808077).
It may have issues with endianness.

Alex

#172 lore raw
In reply to Daniel THOMPSON
Quoted 26 lines · Daniel THOMPSON
Quoted 17 lines · James Chapman
Quoted 16 lines · Mike Frysinger
Quoted 6 lines · Tim Bird
Quoted 5 lines · Mike Frysinger
Quoted 5 lines

Er, is that GPL or LGPL code that you're modifying? If so, you *have* to
push those code changes out (make them available to others), whether you
think people will be interested or not!

Quoted 6 lines
Quoted 3 lines

umm, not really. only if (1) he gives a binary to someone and (2) they ask him for the source. if he doesnt distribute or no one asks, he doesnt have to do squat.

This is closer to correct, but missing some important details.

Start the GPL compliance tutorial/flameware in 3, 2, 1...

yeah, i really dont think licensing things belong here. sorry for following up.

Quoted 7 lines
Quoted 3 lines

how about this policy: if you want to make a statement, go pay a lawyer. but that statement still shouldnt be made here ;). -mike

Sorry, I didn't mean to provoke a GPL flame war. The point I was trying to make (badly as it turns out) is that if a company really wants to see its changes taken upstream, it could simply publish the work on its website and let each relevant community know that it's there.

Quoted 5 lines

Isn't this a lot of the problem with the way embedded companies and developers interact with upstream.

In some cases it is in the embedded developers interests to see their code adopted upstream (i.e. so they don't have to maintain it).

Totally agree! And the best chance of having code accepted upstream is to work with the community _while_ developing it, i.e. discussing the code during implementation, rather than presenting it to the community when it's done. All too often, companies get frustrated by feedback from the community because changes are requested to code that the original authors have spent time testing etc. Had early versions been submitted for feedback, changes could be made with less chance of wasted effort.

Quoted 2 lines

Just tossing some code over the wall will, in almost all circumstances, result in the code being ignored.

It depends. But it stands a better chance of being adopted than holding on to the work until someone asks for it. There could be lots of embedded developers out there who would be willing to take some code from cisco, modify it and work with the community to have it adopted upstream.

Signature · 4 lines
James Chapman
Katalix Systems Ltd
http://www.katalix.com
Catalysts for your Embedded Linux software development
#174 lore raw
In reply to Jim Freeman
Quoted 9 lines · Jim Freeman

Most vendors these days have finally gotten the clue that sources/changes have to be made available to downstream requesters, but far fewer are sufficiently self-enlightened to figure out that changes need to be accepted upstream for them to keep flowing back. And to make that happen, vendors have to take on substantially higher overhead to win acceptance of patches/changes upstream, an undertaking often sadly fraught with hassle, uncertainty, and even peril. So they mostly don't bother. To their (and their customers, and our) long-term detriment.

So - how do you reduce that overhead, then? Keep in mind that while pushing kernel changes upstream is significant, there are other projects as well. Most embedded developers are working not just with the kernel, but with a constellation of packages related to their projects. In order to "push changes upstream", they may end up having to work with several different communities... each with their own model of interaction, their own model of patch submission, and their own release schedules. Figuring out how to deal with just one community (kernel) doesn't help them in dealing with another (say, samba).

When you have a one- or two-line fix, and face Yet Another round of finding the right mailing list, identifying the right maintainers, figuring out the right way to submit a bug and a patch, and then have to spend the next 3 weeks explaining how no, you're not interested in being the PPC maintainer for libfoo... is it any wonder that developers (not to mention their management) eventually just gives up on the idea of "giving back to the community?"

One possible solution would be to provide a clearing house for these sorts of changes, maybe under the auspices of CELF or a similar organization. Instead of submitting patches to individual projects, submit them to the clearing house, and let interested individuals either gather together and push related patches upstream in individual projects, or give project maintainers a place to go and find embedded systems patches related to their projects.

-Samrobb

#147 lore raw

Re: cross-compiling alternatives

In reply to Bernd Petrovitsch
Quoted 5 lines · Bernd Petrovitsch

Actually the size of ints (or any other type) can be easily deduced without running a (for the target) compiled binary:
- compile the binary (for the target) with an initialized variable with that value.
- use cross nm (or a similar tool) to read it from there.

Or the method autoconf uses - binary search, using a compile-time numeric comparison which resolves to a successful or failed compile.

That seems more portable to me.

Relying on 'nm 'finding the variable, and not accidentally matching another variable with the wrong value, does not work for all C environments. E.g. some compile to compressed executables; some produce intermediate objects with incomplete or lazy compiles or symbolic, to be finished at link stage, and some are even more abstract.

And it requires the 'nm' tool, which you might not have for cross-compilation, or might not find the right one.

-- Jamie

#148 lore raw

Re: cross-compiling alternatives

Quoted 9 lines · Jamie Lokier
Quoted 5 lines · Bernd Petrovitsch

Actually the size of ints (or any other type) can be easily deduced without running a (for the target) compiled binary:
- compile the binary (for the target) with an initialized variable with that value.
- use cross nm (or a similar tool) to read it from there.

Or the method autoconf uses - binary search, using a compile-time numeric comparison which resolves to a successful or failed compile.

Good, I didn't know that.

Quoted 1 line

That seems more portable to me.

Yes, just using the compiler is better.

Bernd

Signature · 3 lines
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services
#71 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Mike Frysinger
Quoted 7 lines · Mike Frysinger
Quoted 3 lines
Quoted 1 line

people cant even write proper *native* makefiles. mtd-utils for example ;).

What's wrong with it? I'll fix it.

is [email protected] not the place to post ? that's where i sent the first fix yesterday ... not that i'm subscribed since i dont have a direct interest in mtd development ...

It is. I just missed it. I'll look closer today. Thanks.

josh

#149 lore raw

Re: cross-compiling alternatives

In reply to Jamie Lokier
Quoted 9 lines · On Friday 13 June 2008 15:17:54 you wrote:
Quoted 5 lines · Bernd Petrovitsch

Actually the size of ints (or any other type) can be easily deduced without running a (for the target) compiled binary:
- compile the binary (for the target) with an initialized variable with that value.
- use cross nm (or a similar tool) to read it from there.

Or the method autoconf uses - binary search, using a compile-time numeric comparison which resolves to a successful or failed compile.

How does it do that compile-time numeric comparison ?

Alex

#150 lore raw

Re: cross-compiling alternatives

Quoted 7 lines · Alexander Neundorf
Quoted 6 lines · On Friday 13 June 2008 15:17:54 you wrote:
Quoted 5 lines · Bernd Petrovitsch

Actually the size of ints (or any other type) can be easily deduced without running a (for the target) compiled binary:
- compile the binary (for the target) with an initialized variable with that value.
- use cross nm (or a similar tool) to read it from there.

Quoted 5 lines
Quoted 2 lines

Or the method autoconf uses - binary search, using a compile-time numeric comparison which resolves to a successful or failed compile.

How does it do that compile-time numeric comparison ?

for example you could do

int test[my comparaison];

if my comparaison < 0, the compilation should abort.

Matthieu

#72 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Mike Frysinger
Quoted 7 lines · Mike Frysinger
Quoted 3 lines
Quoted 1 line

people cant even write proper *native* makefiles. mtd-utils for example ;).

What's wrong with it? I'll fix it.

is [email protected] not the place to post ? that's where i sent the first fix yesterday ... not that i'm subscribed since i dont have a direct interest in mtd development ...

It is. I just missed it. I'll look closer today. Thanks.

josh

#176 lore raw
In reply to Jim Freeman
Quoted 3 lines · Jim Freeman

And I'm just betting that when he said "push ... fixes ... out" he meant "work to get them incorporated back upstream", not just make them available to requesters.

Exactly.
That's the essence of opensource development:
Working together, instead of just taking someone else's work.

BTW: everyone here should know that maintaining own branches (this actually happens if you have your own patches not fed back to upstream) is an quite work intensive and sometimes complex task. I doubt anyone here's really eager on doing that ;-P

I understand that not everyone can talk with every project's upstream. Simply too much load. And not every project wants to merge in your patches asap (think of how long it took until expat team took in my really trivial $DESTDIR patch ;-o).

That's why I founded the OSS-QM project: it a kind of "overlay" which provides fixes for a lot of packages in a strictly normalized namespace (so 100% automatic applying is easy).

http://oss-qm.metux.de/

So, eg. if you've made some local changes, please at least feed them to us :)

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#175 lore raw
In reply to Samuel Robb
Quoted 7 lines · Samuel Robb

When you have a one- or two-line fix, and face Yet Another round of finding the right mailing list, identifying the right maintainers, figuring out the right way to submit a bug and a patch, and then have to spend the next 3 weeks explaining how no, you're not interested in being the PPC maintainer for libfoo... is it any wonder that developers (not to mention their management) eventually just gives up on the idea of "giving back to the community?"

ACK.

Quoted 7 lines

One possible solution would be to provide a clearing house for these sorts of changes, maybe under the auspices of CELF or a similar organization. Instead of submitting patches to individual projects, submit them to the clearing house, and let interested individuals either gather together and push related patches upstream in individual projects, or give project maintainers a place to go and find embedded systems patches related to their projects.

See my last mail: that's exactly what the oss-qm project is for:
http://oss-qm.metux.de/

With OSS-QM and related tools you often even don't need your own patching infrastructure - oss-qm provides complete patches against virtually any package/release.

Perhaps a few words on the infrastructure:

* single patches are collected per package, each vendor may get his own namespace/subdir, where he can feed in his patches.
* the single patches are automatically pulled together based on "listfiles" - per package+release there is an simple text file which just lists the single patches to be pulled together.
* each vendor may get it's own namespace for the listfiles.

In other words: if you fear somebody else breaks your already tested/approved packages, just use your own (listfile) namespace.

BTW: CSDB does a similar thing for retrieving source tarballs. Just query the DB, never ever care about individual URLs in you local build system.

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#151 lore raw

Re: cross-compiling alternatives

In reply to Matthieu CASTET
Quoted 7 lines · Matthieu CASTET
Quoted 2 lines

How does it do that compile-time numeric comparison ?

for example you could do

int test[my comparaison];

if my comparaison < 0, the compilation should abort.

Cool trick :)

So, eg if you find out wether some type has an specific size:

int foo[(sizeof(int) == 4)?1:-1];

But: the question is whether you'll need such a test at all or if just using sizeof() at the right place won't do the trick ;-P (yes, I've came around lots of packages where this was the case!)

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#152 lore raw

Re: cross-compiling alternatives

Quoted 2 lines · Enrico Weigelt

But: the question is whether you'll need such a test at all or if just using sizeof() at the right place won't do the trick ;-P

It's best to do that if you can, and nearly always possible. There are a few coding techniques - especially performance sensitive - where that's not feasible.

-- Jamie

#62 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Rob Landley
Quoted 7 lines · Rob Landley

Current compilers have a "build at once" mode where they suck the whole project in and run the optimizer on it at once, resulting in noticeably smaller and faster output at the expense of needing buckets of memory to hold all the source code and intermediate structures in memory at once. The main roadblock to making use of this? Ripping out the existing makefiles and replacing them with a very small shell script that does something similar to "gcc *.c".

Yep, that's a fundamental problem with make that it works only on an per-file basis (which is fine for many projects, but sometimes not).

That's why I prefer an purely descriptive paragidm (= subset of delcarative, but practically no logic): a buildfile should only describe the package's structure (eg.: "i have some executable foo which consists of source [...] and imports libs [...]), so the buildtool (and user's config) can cope with it all.

TreeBuild works this way: http://treebuild.metux.de/

BTW: does anyone known Plan9's mk ?

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#153 lore raw

Re: cross-compiling alternatives

In reply to Jamie Lokier
Quoted 7 lines · Jamie Lokier
Quoted 2 lines · Enrico Weigelt

But: the question is whether you'll need such a test at all or if just using sizeof() at the right place won't do the trick ;-P

It's best to do that if you can, and nearly always possible. There are a few coding techniques - especially performance sensitive - where that's not feasible.

Example ?

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#154 lore raw

Re: cross-compiling alternatives

In reply to Jamie Lokier
Quoted 6 lines · Jamie Lokier

Relying on 'nm 'finding the variable, and not accidentally matching another variable with the wrong value, does not work for all C environments. E.g. some compile to compressed executables; some produce intermediate objects with incomplete or lazy compiles or symbolic, to be finished at link stage, and some are even more abstract.

ACK. And also think of preprocessor symbols (see glibc ;-P) IIRC perl's buildsystem goes this way and so tends to fail.

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#52 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to David Woodhouse

Hi David,

Do you wanna set some breakpoints and inspect variables in makefiles? Have a look at a simple makefile debugger (written in make):
http://newsletter.embedded.com/shared/printableArticle.jhtml?articleID=197003517

Regards,

Robert

---
Robert Berger
Embedded Software Specialist

Reliable Embedded Systems
Consulting Training Engineering
Tel.: (+30) 697 593 3428
Fax.:(+30 210) 684 7881
URL: www.reliableembeddedsystems.com

Quoting David Woodhouse <[email protected]>:

Quoted 14 lines · Rob Landley
Quoted 1 line

Make doesn't scale.

Make scales just fine. The only real problem with make is that it's a complete pain to debug.

--
dwmw2

--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#50 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Alexander Neundorf
Quoted 3 lines · Alexander Neundorf

In general, cross compiling is not hard. You just have to call the cross toolchain, give it the correct parameters, search files in the right location and ... make sure you don't test stuff by running programs.

Same with carefully written makefiles ;-P

Quoted 2 lines

Basically only the last one is problematic (but IMO still less problematic than running a virtual system on the host just to build something).

Yes, and that should be completely prohibited.

Quoted 9 lines

How does cmake support that for cross compiling ?
If it detects a try_run() (which is the command for building a test executable and then running it) in cross compiling mode (i.e. when it was told what the target platform is instead of just assuming it's the same as the build host), then it

(quoted diff) +0 -4
-issues a warning
-stores the created executable in a place so the developer can find it
-running some existing executable and checking its output
-creates a file where the developer can enter the results which running the 
Quoted 4 lines

executable on the target host would have brought (includes comments where that command was found, the arguments, etc.,). The developer can then run the test executable manually on the target and enter the results. This seems to be similar to the config.cache somebody mentioned for debian.

Yes, introducing the problems as with autoconf. You'll have to maintain one cachefile per package - there is *NO* standard on it's variables. And exactly that's the key problem !

Therefore unitool has an generic platform database, where such generic platform parameters can be set. These fields have to be standardized, (adding new ones for some specific package is definitively the wrong way).

Quoted 1 line

So really the hard part is getting rid of running stuff to check the platform.

Isnt that hard. In all these years I had no case where it couldn't be circumvented.

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#155 lore raw

Re: cross-compiling alternatives

In reply to Bernd Petrovitsch
Quoted 7 lines · Bernd Petrovitsch
Quoted 4 lines

Basically yes. But if you have a big number of packages (or a huge package) which you didn't write yourself, there will be tests which run executables. Figuring out what all the tests are supposed to test in a complex unknown software project is not trivial.

Yes, you get used to find the relevant lines in config.log and similar with grep and similar tools;-)

Which are different on each package. So you have to configure each package for each target manually, which leads the whole point of autoconf ad absurdum ;-o

Quoted 2 lines

But most embedded projects haven't that much number of "large tools" - mainly because the space is limited.

I'm probably not quite representative, but I'm using crosscompile techniques also for building to the same arch - mainly for QM reasons.

Quoted 4 lines

pkg-config generated (and generates? - I didn't check recently) references to libraries including the full absolute path (which is the one at build time. And at run-time there is usually
no /home/bernd/src/... or where some build may just run).

Recent pkg-config supports sysroot.
So you simply build your .pc files as usual (w/o sysroot prefix) and set the sysroot prefix via env on the pkg-config call.

Quoted 3 lines
Quoted 3 lines

Can you please explain ? How do the generated pkg_config files look like ? Ahh, you mean they contain e.g -L/my/build/host/target/environment/opt/foo/lib instead of just -L/opt/foo/lib ?

Then you've got a broken .pc file ;-P

Quoted 3 lines

Yes. And even worse the compiled lib "foo" had explicit dependencies (on lib "bar") on "/my/build/host/target/environment/opt/bar/lib/libbar.so.1.2.3.4".

And that's even more broken.

Quoted 2 lines

And BTW pkg-config didn't support the concept of a "DESTDIR" variable (and I don't care about the name of that variable).

No, why should it ?! It does not install anything. Probably you're looking for sysroot ?

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#163 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Alexander Neundorf

Review

Quoted 6 lines · Alexander Neundorf

Well, IMO this makes it sound too easy.
If you write portable software, you have to do platform checks. Basically they can be done by

(quoted diff) +0 -3
-checking for the existence of files
-checking if something builds
-checking the output of running something you just built

Some concerete examples where you really *need* that ?

Quoted 8 lines

The last one is the problem for cross compiling.
Example: detecting the size of ints

Easy way:

...
printf("%d\n", sizeof(long));
...

Why not directly using sizeof() in your code ?

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#137 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Alexander Neundorf
Quoted 4 lines · Alexander Neundorf

E.g. in python there are tests which call functions and check their result to see if we are currently on a platform where that function is broken (I think there was such a test for poll() and some other functions).

IMHO, that's broken sw engineering from ground up.

BTW: python is one of the packages didn't pass a single one of my QM constraints (hey, not completely corrent, IMHO, install prefix was passed ;-O)

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#53 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to [email protected]
Quoted 3 lines · On Fri, 2008-06-13 at 10:02 -0500, linux-embedded-owner@reliableembeddedsystems…

Do you wanna set some breakpoints and inspect variables in makefiles? Have a look at a simple makefile debugger (written in make):
http://newsletter.embedded.com/shared/printableArticle.jhtml?articleID=197003517

404.

You got me all excited there...

Signature · 1 line
dwmw2
#54 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

Quoted 7 lines
Quoted 3 lines · On Fri, 2008-06-13 at 10:02 -0500, linux-embedded-owner@reliableembeddedsystems…

Do you wanna set some breakpoints and inspect variables in makefiles? Have a look at a simple makefile debugger (written in make):
http://newsletter.embedded.com/shared/printableArticle.jhtml?articleID=197003517

404.

Is this what the link was supposed to be:

http://www.embedded.com/columns/technicalinsights/197003517?printable=true

or in non-printable format:

http://www.embedded.com/columns/technicalinsights/197003517?_requestid=145614

Man, I must be bored today ;)

Quoted 12 lines

You got me all excited there...

--
dwmw2

--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#59 lore raw

Makefile debugger

In reply to [email protected]

Sorry, the link did not work.
It wants to pass by my webpage;)

Use this:
http://www.reliableembeddedsystems.com/newsflashes/newsflash/debugging-makefiles.html

Regards,

Robert

---
Robert Berger
Embedded Software Specialist

Reliable Embedded Systems
Consulting Training Engineering
Tel.: (+30) 697 593 3428
Fax.:(+30 210) 684 7881
URL: www.reliableembeddedsystems.com

Quoting [email protected]:

Quoted 43 lines

Hi David,

Do you wanna set some breakpoints and inspect variables in makefiles? Have a look at a simple makefile debugger (written in make):
http://newsletter.embedded.com/shared/printableArticle.jhtml?articleID=197003517

Regards,

Robert

---
Robert Berger
Embedded Software Specialist

Reliable Embedded Systems
Consulting Training Engineering
Tel.: (+30) 697 593 3428
Fax.:(+30 210) 684 7881
URL: www.reliableembeddedsystems.com

Quoting David Woodhouse <[email protected]>:

Quoted 6 lines · Rob Landley
Quoted 1 line

Make doesn't scale.

Make scales just fine. The only real problem with make is that it's a complete pain to debug.

Quoted 8 lines

--
dwmw2

--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#81 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Bill Gatliff
Quoted 9 lines · On Thursday 12 June 2008 12:14:32 Bill Gatliff wrote:
Quoted 4 lines · Paul Mundt

Yes, that's the easy case. It's things like perl that are the corner cases, and my objection comes from the fact that people think we ought to not have the kernel depend on perl rather than just fixing the package itself. Autoconf/libtool damage is an entirely different problem :-)

At first glance, it seems like checkincludes.pl could be duplicated by egrep | uniq | wc vs. egrep | wc. Not quite sure what checkversion.pl is trying to do.

There's a difference between "this is a development tool used while modifying source code" and "this is needed to build".

There are situations where it's ok to have a dependency on X11/qt/gtk, such as "make xconfig". This is _not_ the same as adding such dependency to "make modules".

So far, none of the perl dependencies prevent you from building the kernel on a system that didn't have perl (or didn't have the right version of perl).

Quoted 3 lines

So maybe we could _reduce_ dependency on perl, if there's any advantage to gain by doing so. But the kernel build machinery isn't dependent on very many other systems (just tcl, bash and gcc-core),

There's no tcl dependency in the build. (Yes, I actually know this.)

Part of my FWL work involves getting the system to rebuild itself under itself. (The packages you need to make a minimal self-bootstrapping system are gcc, binutils, make, bash, uClibc, linux, and busybox/toybox). I'm seven commands away from doing this.

I know this because I made a horrible little wrapper (attached, it really is sad) which touched a file with the name it was called as and then exec()ed the actual executable out of another directory. Then I populated a directory with symlinks to every executable in $PATH (for i in echo $PATH | sed 's/:/ /g';do for j in ls $i; do ln -s $i/$j $j; done; done), and another directory of similar symlinks to my wrapper. I then ran my build with that wrapper directory at the start of $PATH and let the wrapper populate a directory with all the executables that actually got called during the build. Then I filled up a directory with those executables, tried to run the build, and figured out why it broke. (The above approach won't find calls to /bin/bash and a few other things, but it's a good start.)

Most of the point of my ./host-tools.sh wrapper in the FWL build is to populate a directory with the command line utilities mini-native will have in it (specifically the busybox/toybox versions, not the ones in the host system), and set $PATH equal to that directory and only that directory. This way I know the system will build under itself because that's how it's building in the first place.

Currently, I need to grab the following out of the host system:

for i in ar as nm cc gcc make ld bzip2 find install od sort diff wget
do
[ ! -f "${HOSTTOOLS}/$i" ] && (ln -s which $i "${HOSTTOOLS}/$i" || dienow)
done

The first seven are the needed bits of the host toolchain (you'd think "strip" would be in there, but it turns out those packages only ever use $TARGET-strip). The last seven are the ones that are either missing or had various bugs in the version of busybox I'm using that prevented the build from working right.

Rob

Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include <fcntl.h>

char blah[65536];

#define ROOTPATH "/home/landley/firmware/firmware"

int main(int argc, char *argv[], char *env[])
{
char *p, *p2;

int i, fd;

  p2 = strrchr(*argv, '/');
  if (!p2) p2=*argv;
  else p2++;

  p=blah + sprintf(blah, "%s ",p2);
  for (i=1; i<argc; i++) {
    p += sprintf(p, "\"%s\" ",argv[i]);
  }
  p[-1]='\n';

// Log the command line

  fd=open(ROOTPATH "/loggy.txt",O_WRONLY|O_CREAT|O_APPEND,0777);
  write(fd, blah, strlen(blah));
  close(fd);

// Touch the file that got used.

  sprintf(blah,ROOTPATH "/used/%s", p2);
  close(open(blah, O_WRONLY|O_CREAT, 0777));

  // Hand off control to the real executable
  sprintf(blah, ROOTPATH "/handoff/%s", p2);
  execve(blah, argv, env);

// Should never happen, means handoff dir is set up wrong. dprintf(2,"Didn't find %s\n", *argv);
exit(1);
}

#55 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Bill Traynor
Quoted 3 lines · Bill Traynor
Quoted 2 lines
Quoted 2 lines

Do you wanna set some breakpoints and inspect variables in makefiles? Have a look at a simple makefile debugger (written in make):

http://www.embedded.com/columns/technicalinsights/197003517?printable=true

The article above shows some macros you can add to your Makefile to show you the values of certain things. It is helpful, but not an interactive debugger.

However, the guy who wrote that article did indeed write a full Makefile debugger. I took it for a spin, and found that it worked as advertised on a simple Makefile. I tried it on the kernel Makefile, but without success (but I didn't try very hard).

YMMV. I put some of the resources and info I found at:
http://elinux.org/Debugging_Makefiles

The link from the package's README doesn't work, but here's a link I found to an article about the debugger:
http://www.cmcrossroads.com/content/view/6479/120/

-- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum Senior Staff Engineer, Sony Corporation of America
=============================

#156 lore raw

Re: cross-compiling alternatives

In reply to Enrico Weigelt
Quoted 11 lines · Enrico Weigelt
Quoted 7 lines · Bernd Petrovitsch
Quoted 4 lines

Basically yes. But if you have a big number of packages (or a huge package) which you didn't write yourself, there will be tests which run executables. Figuring out what all the tests are supposed to test in a complex unknown software project is not trivial.

Yes, you get used to find the relevant lines in config.log and similar with grep and similar tools;-)

Which are different on each package. So you have to configure each package

ACK.

Quoted 2 lines

for each target manually, which leads the whole point of autoconf ad absurdum ;-o

Yup.

[...]

Quoted 6 lines
Quoted 4 lines

pkg-config generated (and generates? - I didn't check recently) references to libraries including the full absolute path (which is the one at build time. And at run-time there is usually
no /home/bernd/src/... or where some build may just run).

Recent pkg-config supports sysroot.

FC-6 has "only" 0.21.

Quoted 2 lines

So you simply build your .pc files as usual (w/o sysroot prefix) and set the sysroot prefix via env on the pkg-config call.

From a quick glance over the man page of 0.23, yes.

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

Can you please explain ? How do the generated pkg_config files look like ? Ahh, you mean they contain e.g -L/my/build/host/target/environment/opt/foo/lib instead of just -L/opt/foo/lib ?

Then you've got a broken .pc file ;-P

The problem is that the build-time (cross-)linker needs to find the (cross-compiled) lib under /my/build/host/target/environment/opt/foo/lib at link time and the shared linker under /opt/foo/lib at run-time. Hmm, after digging into that old project, it seems that libtool and the .la files were the problem.

Quoted 5 lines
Quoted 3 lines

Yes. And even worse the compiled lib "foo" had explicit dependencies (on lib "bar") on "/my/build/host/target/environment/opt/bar/lib/libbar.so.1.2.3.4".

And that's even more broken.

Yup. Maybe it was a result of my trial to make libtool work somehow ..

Quoted 4 lines
Quoted 2 lines

And BTW pkg-config didn't support the concept of a "DESTDIR" variable (and I don't care about the name of that variable).

No, why should it ?! It does not install anything.

But it may "use" installed files.

Quoted 1 line

Probably you're looking for sysroot ?

Yes, very probably.

Bernd

Signature · 3 lines
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services
#95 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Enrico Weigelt
Quoted 3 lines · Enrico Weigelt

ACK. One of the first things I did was replacing libtool and kicked off broken-by-design macros like AC_TRY_RUN. This solved at >80% of the problems for me.

Instead of hacking around and inventing new things, you should have spent your time for improving libtool ...

rsc

Signature · 5 lines
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9
#131 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Sam Ravnborg
Quoted 7 lines · Sam Ravnborg

Tom has started a nice project which he named: quagmire.
See: http://code.google.com/p/quagmire/

From the website:
quagmire is intended to replace automake and libtool. Unlike these tools it requires GNU make and is written solely using GNU make features -- no preprocessing is required.

Last time I looked it had *at least* 0.1% of the autotools features supported :-)

rsc

Signature · 5 lines
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9
#104 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Alexander Neundorf
Quoted 3 lines · Alexander Neundorf

Battle of Wesnoth is currently converted to both Scons and CMake, and in the end they will decide about the winner. (since Eric is good at arguing I guess it will be scons).

The thing is that 'configure && make && make install' plus the usuall --enable-foo / --disable-foo / --with-bla=blub semantics is simply *the* standard way of configuring stuff for unix systems. You don't need fancy tools, you get cross compiling almost for free and unix people simply know how to use it.

All the cool kids out there who think they know everything better usually start with "I hate autotools", then invent something which solves 0.1% of the problems (including their very special problem) and tell the rest of the world that their shiny new tools is *soooo cooool*.

Been there, seen that. I maintain > 500 packets in PTXdist and guess which ones make 90% of the problems. Hint: they are not related to autotools ...

rsc

Signature · 5 lines
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9
#56 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Tim Bird
Quoted 14 lines · Tim Bird
Quoted 3 lines · Bill Traynor
Quoted 2 lines
Quoted 2 lines

Do you wanna set some breakpoints and inspect variables in makefiles? Have a look at a simple makefile debugger (written in make):

http://www.embedded.com/columns/technicalinsights/197003517?printable=true

The article above shows some macros you can add to your Makefile to show you the values of certain things. It is helpful, but not an interactive debugger.

However, the guy who wrote that article did indeed write a full Makefile debugger. I took it for a spin, and found that it worked as advertised on a simple Makefile. I tried it on the kernel Makefile, but without success (but I didn't try very hard).

Quoted 6 lines

YMMV. I put some of the resources and info I found at:
http://elinux.org/Debugging_Makefiles

The link from the package's README doesn't work, but here's a link I found to an article about the debugger:
http://www.cmcrossroads.com/content/view/6479/120/

Quite impressive what he got out of the make features. The kernel does a few unusual tricks so I do understand why it does not work there.

Speaking about the kernel...
Try "make V=2" one day to see why a target are build. It is quite useful when a small change results in much more being build than you expected. But this is kernel specific and not a general feature.

Sam

#57 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Tim Bird
Quoted 14 lines
Quoted 3 lines · Bill Traynor
Quoted 2 lines
Quoted 2 lines

Do you wanna set some breakpoints and inspect variables in makefiles? Have a look at a simple makefile debugger (written in make):

http://www.embedded.com/columns/technicalinsights/197003517?printable=true

The article above shows some macros you can add to your Makefile to show you the values of certain things. It is helpful, but not an interactive debugger.

However, the guy who wrote that article did indeed write a full Makefile debugger. I took it for a spin, and found that it worked as advertised on a simple Makefile. I tried it on the kernel Makefile, but without success (but I didn't try very hard).

Quoted 6 lines

YMMV. I put some of the resources and info I found at:
http://elinux.org/Debugging_Makefiles

The link from the package's README doesn't work, but here's a link I found to an article about the debugger:
http://www.cmcrossroads.com/content/view/6479/120/

The links in the README worked fine for me. FWIW, the authors homepage is
here: http://gmd.sf.net He's written a self-published book on GNU Make, it would seem.

Quoted 15 lines

-- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum Senior Staff Engineer, Sony Corporation of America
=============================

--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#157 lore raw

Re: cross-compiling alternatives

In reply to Bernd Petrovitsch
Quoted 3 lines · Bernd Petrovitsch
Quoted 1 line

Recent pkg-config supports sysroot.

FC-6 has "only" 0.21.

Solved in ptxdist by building the "right" pkgconfig as a host tool.

Quoted 2 lines
Quoted 2 lines

So you simply build your .pc files as usual (w/o sysroot prefix) and set the sysroot prefix via env on the pkg-config call.

Ah, great, must be a new feature. Will have to integrate that into ptxdist... at the moment we fix it with a wrapper script.

Quoted 4 lines

The problem is that the build-time (cross-)linker needs to find the (cross-compiled) lib under /my/build/host/target/environment/opt/foo/lib at link time and the shared linker under /opt/foo/lib at run-time.

pkg-config is fixable (our wrapper in PTXdist does the right thing wrt. buildtime vs. runtime paths).

Quoted 2 lines

Hmm, after digging into that old project, it seems that libtool and the .la files were the problem.

Right, libtool's paths are critical: libtools isn't sysroot aware, and it seems to be not easily fixable.

rsc

Signature · 5 lines
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9
#162 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Alexander Neundorf
Quoted 5 lines · On Friday 13 June 2008 04:06:18 Alexander Neundorf wrote:
Quoted 1 line

And the above are not really a big problem -

"checking if something builds" is no problem, this just works. Running something is a problem, as in "it doesn't just work" (...because you cannot run it).

Noticing 2 weeks after deployment that signal handling in the mips version of perl is using the x86 signal numbers and they're not the same: priceless.

Quoted 7 lines
Quoted 4 lines

The only simple solution so far (without diving into the implementation and searching for root causes) were AFAICS:
- do not use libtool for linking (as the link line as such without libtool works as expected)

Yes, libtool sucks, it's the wrong solution to the problem. (and CMake doesn't use it).

Nothing on Linux really _uses_ libtool. It's supposed to act as a NOP wrapper around the linker on any Linux target. (It's there for things like Sparc and HPUX).

The fact that libtool manages to do its nothing _wrong_ so often would be hilarious if it wasn't such a pain. Just uninstall libtool before trying to build for a Linux target, this should never cause any problems and will save you lots of headaches.

Quoted 3 lines
Quoted 3 lines

Why on earth does someone need this explicitly during the build? If you have portable software, all of that should be hidden in the code and use "sizeof(int)".

According to the LP64 standard which pretty much all modern Unixes adhere to (including both Linux and MacOS X) sizeof(int) is always 4. Guaranteed.

The LP64 standard:
http://www.unix.org/whitepapers/64bit.html

The LP64 rationale:
http://www.unix.org/version2/whatsnew/lp64_wp.html

The insane legacy reasons windows doesn't do this, but in fact sizeof(int) will still be 4 there anyway:
http://blogs.msdn.com/oldnewthing/archive/2005/01/31/363790.aspx

Just FYI. :)

Quoted 3 lines

But this was not the point. My point was: testing something by running an executable can be _a lot_ easier than testing the same without running something.

I think building natively under qemu is the easy way, yes. :)

Quoted 5 lines

Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.
#177 lore raw
In reply to James Chapman
Quoted 12 lines · James Chapman
Quoted 11 lines · David VomLehn
Quoted 10 lines · Enrico Weigelt
Quoted 4 lines · Rob Landley

Cross compiling breaks stuff, yes.

Most packages don't cross compile at all. Debian has somewhere north of 30,000 packages. Every project that does large scale cross compiling (buildroot, gentoo embedded, timesys making fedora cross compile, etc) tends to have about 200 packages that cross compile more or less easily, another 400 or so that can be made to cross compile with _lot_ of effort and a large enough rock, and then the project stalls at about that size.

The problem is: most embedded projects don't make really general-purpose
fixes (instead strange things like hacking up autogenerated files), so they can't feed back to upstream.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

IMHO, a huge waste of working time.

Amen, brother. I'm fortunate in that I work for an organization that is quite good about enforcing code reviews, specifically, the QA organization is empowered to reject changes that do not have code review notes. I also have a fairly broad scope, so I'm in on code reviews for a number of open source components. At each such review, one of my criteria is whether the change is suitable for pushing back to the appropriate community. This is not necessarily a short-term way to make friends, but the long-term effects will be good both for the company and for the open source community in general.

Now, if we can only get the time to actually push all the backlogged fixes out...

Er, is that GPL or LGPL code that you're modifying? If so, you *have* to push those code changes out (make them available to others), whether you think people will be interested or not!

I guess I'm making a distinction that wasn't clear. We *have* to make the code available, and I can assure you that Cisco is very aware of our obligations in this area and I spend a fair amount of my time trying to ensure they are met.

I used the term "push" to mean getting patches ready, posting them to the appropriate mailing lists, revising them in light of comments, and doing everything else necessary to get them incorporated into the kernel source base. "Pushing" is a lot more work than just making source available, but also yield much more productive long term results for everyone.

Signature · 10 lines
David VomLehn, [email protected]
The opinions expressed herein are likely mine, but might not be my employer's...






    - - - - -                              Cisco                            - - - - -         
This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.
#105 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Robert Schwebel
Quoted 10 lines · Robert Schwebel
Quoted 3 lines · Alexander Neundorf

Battle of Wesnoth is currently converted to both Scons and CMake, and in the end they will decide about the winner. (since Eric is good at arguing I guess it will be scons).

The thing is that 'configure && make && make install' plus the usuall --enable-foo / --disable-foo / --with-bla=blub semantics is simply *the* standard way of configuring stuff for unix systems. You don't need fancy tools, you get cross compiling almost for free and unix people simply know how to use it.

A trouble with that is some packages have hundreds of user-selectable options - or even thousands. It is unfeasible to use --enable-foo options for all of those when configuring then.

Some other packages _should_ have more options, but don't because it's too unwieldy to make them highly configurable with Autoconf. Imho, Kconfig would be good for more programs than it's currently used for, and could be made to work with those --enable/--with options: you'd be able to configure them entirely on the command line, or interactively with "./configure --menu" (runs menuconfig), or with a config file.

The "make" / "make install" part is easy to retain even with other build systems, using a trivial Makefile which calls the other tools. Lots of packages need special tools or other software installed to build them; this is no different.

Perhaps it might even be possible to write a very small, portable, specialised alternative to Make which is small enough to ship with packages that use it?

-- Jamie

#106 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

Quoted 2 lines · Jamie Lokier

A trouble with that is some packages have hundreds of user-selectable options - or even thousands.

I've not seen a package with thousands of user selectable options. It's not even desirable, because the more options you have, the more difficult it becomes to test all the combinations.

Quoted 6 lines

Some other packages _should_ have more options, but don't because it's too unwieldy to make them highly configurable with Autoconf. Imho, Kconfig would be good for more programs than it's currently used for, and could be made to work with those --enable/--with options: you'd be able to configure them entirely on the command line, or interactively with "./configure --menu" (runs menuconfig), or with a config file.

That's exactly what ptxdist does: add a Kconfig frontend to the configurable switches. It does it for the user's convenience, although the currently implemented method is really developer-unfriendly (but we care about our users first).

But it's of absolutely no use to whine about the fact that the world is such a curel place. *If* Kconfig had been there 20 years ago ... *if* 90% of the packages out there would have been Kconfig instead of autotools... We have to live with *reality*, and reality is that autotools solve real world problems, and they offer *one* standard user interface to package building. I can cross build almost all autotoolized packages in exactly the same way and people are used to it. All other build systems I've seen invented their very special way of doing things, leading to wheel-reinvention all over the place.

Quoted 2 lines

The "make" / "make install" part is easy to retain even with other build systems, using a trivial Makefile which calls the other tools.

I still don't understand why all the scons, cmakes and jams out there don't even try to provide the *standard* user interface everyone is used to on a unix system.

Quoted 2 lines

Lots of packages need special tools or other software installed to build them; this is no different.

autotools need only a shell and make

Quoted 3 lines

Perhaps it might even be possible to write a very small, portable, specialised alternative to Make which is small enough to ship with packages that use it?

Why on earth would one want to reinvent make?

rsc

Signature · 5 lines
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9
#107 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

Quoted 7 lines · Robert Schwebel
Quoted 2 lines · Jamie Lokier

A trouble with that is some packages have hundreds of user-selectable options - or even thousands.

I've not seen a package with thousands of user selectable options. It's not even desirable, because the more options you have, the more difficult it becomes to test all the combinations.

Kernels, uclibc, busybox. All combinations can't be tested. But it's still _very_ useful to compile in only those parts wanted.

Most packages have far fewer. But some have enough that the command line is unwieldy and Kconfig would fit. I'm thinking libcurl - one configure option for each protocol supported. iptables (userspace) would be a candidate, when you have to link statically and save space.

Media players with lots of optional formats and drivers are another. (They also have considerable problems with their Autoconf in my experience).

Generally, anything with lots of parts that different applications might not use, and space or library dependencies are an issue.

Quoted 11 lines
Quoted 6 lines

Some other packages _should_ have more options, but don't because it's too unwieldy to make them highly configurable with Autoconf. Imho, Kconfig would be good for more programs than it's currently used for, and could be made to work with those --enable/--with options: you'd be able to configure them entirely on the command line, or interactively with "./configure --menu" (runs menuconfig), or with a config file.

That's exactly what ptxdist does: add a Kconfig frontend to the configurable switches. It does it for the user's convenience, although the currently implemented method is really developer-unfriendly (but we care about our users first).

I agree. (And it proved about not being able to test more
combinations: last time I tried to build ptxdist, an up to date version (at the time), it failed in several places.)

Quoted 9 lines

But it's of absolutely no use to whine about the fact that the world is such a curel place. *If* Kconfig had been there 20 years ago ... *if* 90% of the packages out there would have been Kconfig instead of autotools... We have to live with *reality*, and reality is that autotools solve real world problems, and they offer *one* standard user interface to package building. I can cross build almost all autotoolized packages in exactly the same way and people are used to it. All other build systems I've seen invented their very special way of doing things, leading to wheel-reinvention all over the place.

I agree with you. There's no need to disagree, and who's whining? We're trying to think of realistic improvments.

Reality is that Kconfig front end to autotools does work - as you've proved. It's a good idea. :-)

Quoted 6 lines
Quoted 2 lines

The "make" / "make install" part is easy to retain even with other build systems, using a trivial Makefile which calls the other tools.

I still don't understand why all the scons, cmakes and jams out there don't even try to provide the *standard* user interface everyone is used to on a unix system.

Me neither.

Quoted 4 lines
Quoted 2 lines

Lots of packages need special tools or other software installed to build them; this is no different.

autotools need only a shell and make

No, that's true only for very simple packages.

Most packages need lots of additional libraries installed - and the
development versions of those libraries, for that matter. Too often
the right development version - not too recent, not too old. With the wrong versions, there are surprises.

You said about too many user-selectable options. Many large packages _check_ for many installed libraries. Get them wrong, and you have the same problems of untested combinations.

Quite a lot of packages require extra tools to build, beyond shell, make, GCC and Binutils. Perl, Python are common.

Sure, autotools by themselves don't need much. But that's not
interesting: Autotools are not used only by themselves.

Quoted 5 lines
Quoted 3 lines

Perhaps it might even be possible to write a very small, portable, specialised alternative to Make which is small enough to ship with packages that use it?

Why on earth would one want to reinvent make?

Have you felt uncomfortable shipping a package that does use Autoconf, Automake and Libtool, knowing that the scripts generated by those tools are huge compared with the entire source of your package?

Have you _written_ Autoconf tests recently? Made any shell / shellutils non-portability mistakes in the tests?

Have you _read_ a portable Makefile lately? Have you tried writing one for a complex package, confident that it's portable to different quirky makes, quirky shells and quirky tools, outside the parts which you might use Automake for?

That's a rationale for the project which is rewriting Autotools in GNU Make, assuming that to be ubiquitous now, imho. (Not all interesting systems have a shell either.)

If you're going to rewrite Autotools using GNU Make, why not ask if another tool would be better, perhaps a tool specially designed for the job?

-- Jamie

#138 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Enrico Weigelt
Quoted 8 lines · Enrico Weigelt
Quoted 4 lines · Alexander Neundorf

E.g. in python there are tests which call functions and check their result to see if we are currently on a platform where that function is broken (I think there was such a test for poll() and some other functions).

IMHO, that's broken sw engineering from ground up.

Oh? The alternative I see is to do the test at run-time. But that adds to executable size and run-time slowdown on most platforms.

Doing it at build time is an improvement, for those people who don't care about cross-compilation. (Not me, you understand.)

-- Jamie

#108 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Jamie Lokier
Quoted 2 lines · Jamie Lokier

Kernels, uclibc, busybox. All combinations can't be tested. But it's still _very_ useful to compile in only those parts wanted.

Kernel (and thus kconifg) is a critical mass project of it's own; however, kconfig does only solve the "configuration" problem. Autotools is much more. However, I was talking about userspace software. Core components have usually much different needs.

Quoted 3 lines

Media players with lots of optional formats and drivers are another. (They also have considerable problems with their Autoconf in my experience).

Send patches :-)

Quoted 2 lines

Generally, anything with lots of parts that different applications might not use, and space or library dependencies are an issue.

According to my experience, the configure part of autotools is not it's problem. Its more

- configure scripts are slow
- libtool isn't sysroot/destdir aware
- complex cross scenarios are not well supported (i.e. ace/tao, where the IDL compiler needs most of libace and has to be compiled for both, the "build" and "host" system)

Quoted 8 lines
Quoted 4 lines

That's exactly what ptxdist does: add a Kconfig frontend to the configurable switches. It does it for the user's convenience, although the currently implemented method is really developer-unfriendly (but we care about our users first).

I agree. (And it proved about not being able to test more
combinations: last time I tried to build ptxdist, an up to date version (at the time), it failed in several places.)

Did you tell the development team? We are known to fix 95% of the problems in this universe in less than 10 minutes :-)

However, we have a stable policy in the meantime (1.0.x is in maintenance only mode, regularly tested and quickly fixed), and the team is really responsive. So it may be time to try it out again :-)

Quoted 3 lines
Quoted 1 line

autotools need only a shell and make

No, that's true only for very simple packages.

Ok, plus normal unix tools like sed and awk ...

Quoted 4 lines

Most packages need lots of additional libraries installed - and the development versions of those libraries, for that matter. Too often the right development version - not too recent, not too old. With the wrong versions, there are surprises.

Right. But this is the downside of being able to deal with all this
complexity: every other build system would have the same problem.

Quoted 3 lines

You said about too many user-selectable options. Many large packages _check_ for many installed libraries. Get them wrong, and you have the same problems of untested combinations.

Yup, auto-testing is usually a problem if you build cross stuff.

Quoted 2 lines

Sure, autotools by themselves don't need much. But that's not
interesting: Autotools are not used only by themselves.

They don't need a special runtime environment other than shell. Other systems like Perl, Python, Java or whatever has the problem that anything other than the very core is not very well defined and ends up in the version hell.

We have once tried to write our automated test system for embedded boards with python and xml; the idea was to have something fancy, new and with good code-reuse. In the end it failed because the pexpect package we used to do the pattern matching bitrotted so quickly that four months later all the fancy tests didn't work any more, because it is not part of the python core.

In the meantime we have migrated our automatic testing stuff to use shell, ssh/rsh and kermit. It is rock solid, and the code reuse factor is at least as good as with anything else.

Quoted 3 lines

Have you felt uncomfortable shipping a package that does use Autoconf, Automake and Libtool, knowing that the scripts generated by those tools are huge compared with the entire source of your package?

No :-)

Quoted 1 line

Have you _written_ Autoconf tests recently?

Yea, all our packages are autotoolized.

Quoted 1 line

Made any shell / shellutils non-portability mistakes in the tests?

Yea, it happens in ptxdist all the time. People report about problems, we add new tests and the next revision works even on Ubuntu :)

Quoted 8 lines

Have you _read_ a portable Makefile lately? Have you tried writing one for a complex package, confident that it's portable to different quirky makes, quirky shells and quirky tools, outside the parts which you might use Automake for?

That's a rationale for the project which is rewriting Autotools in GNU Make, assuming that to be ubiquitous now, imho. (Not all interesting systems have a shell either.)

I have no problems with people writing fancy new things. It's just that most people who try to do something better than autotools have only a fraction of the features.

Open Source is darwinism: if there is something better, let's use it. But compare apples with apples.

Quoted 3 lines

If you're going to rewrite Autotools using GNU Make, why not ask if another tool would be better, perhaps a tool specially designed for the job?

Go ahead.

rsc

Signature · 5 lines
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9
#178 lore raw
In reply to Rob Landley

Hello all,

Quoted 8 lines · Rob Landley

Most packages don't cross compile at all. Debian has somewhere north of 30,000 packages. Every project that does large scale cross compiling (buildroot, gentoo embedded, timesys making fedora cross compile, etc) tends to have about 200 packages that cross compile more or less easily, another 400 or so that can be made to cross compile with _lot_ of effort and a large enough rock, and then the project stalls at about that size.

Agreed, OpenEmbedded has a few thousands, but your point is valid. However, fleeing to target-native compilation is not the way to improve the situation IMHO.

Moore's law on hardware also goes for the host, I think the progress is even bigger on big iron.

Also, how much of the 30000 packages are useful for something like your own firmware Linux?

Quoted 3 lines

Distcc can take advantage of smp, but that won't help the ./configure stage and I need to do some work on distcc to teach it to understand more gcc

If you want to build 1000+ packages, you don't need to run configure itself multithreaded. There are enough jobs available to keep 16/32 processors busy (beyond that, you probably end up in inter-package-dependencies stalling the build). This is just a guess from what I see during a multi-threaded bake and multi-threaded make on OpenEmbedded.

Quoted 4 lines

However, having one or more full-time engineers devoted to debugging cross-compile issues is quite a high price to pay too. Moore's law really doesn't help that one.

How about 30+ volunteers.

Quoted 5 lines

I'm not saying either solution is perfect, I'm just saying the "build under emulation" approach is a viable alternative that gets more attractive as time passes, both because of ongoing development on emulators and because of Moore's law on the hardware.

I cannot follow your reasoning - Moore's law will help you more on the big iron side of things.

That said, I welcome any effort (such as yours) to help improve the embedded Linux domain, I rather try to fix the cross-compile stuff of the few thousand packages I am interested in.

Yes it hurts my brain.

Regards,

Signature · 1 line
Leon
#179 lore raw
Quoted 10 lines · On Sunday 15 June 2008 10:39:43 Leon Woestenberg wrote:

Hello all,

Quoted 6 lines · Rob Landley

Most packages don't cross compile at all. Debian has somewhere north of 30,000 packages. Every project that does large scale cross compiling (buildroot, gentoo embedded, timesys making fedora cross compile, etc) tends to have about 200 packages that cross compile more or less easily, another 400 or so that can be made to cross compile with _lot_ of effort and a large enough rock, and then the project stalls at about that size.

Quoted 3 lines

Agreed, OpenEmbedded has a few thousands, but your point is valid. However, fleeing to target-native compilation is not the way to improve the situation IMHO.

You say it like fleeing is a bad thing. :)

I believe building natively under emulation is the Right Thing. Cross compiling has always historically been a transitional step until native compiling became available on the target.

When Ken Thompson and Dennis Ritchie were originally creating Unix for the PDP-7, they cross compiled their code from a honking big GE mainframe because that was their only option. One of the first things they wrote was a PDP-7 assembler that ran on the PDP-7. The reason they created the B programming language in the first place was to have a tiny compiler that could run natively on the PDP-7, and when they moved up to a PDP-11 Dennis had more space to work with and expanded B into C.

When they severed the mainframe umbilical cord as soon as they were able to get the system self-hosting, it wasn't because the PDP-7 had suddenly become faster than the GE mainframe.

Compiling natively where possible has been the normal way to build Unix software ever since. Linux became a real project when Linus stopped needing Minix to cross-compile it. Linus didn't "flee" Minix, he assures us he erased his minix partition purely by accident. :)

Quoted 1 line

Moore's law on hardware also goes for the host,

Which is why people no longer regularly write application software in assembly language, because we don't need to do that anymore. The result would be faster, but not better.

The rise of scripting languages like Python and javascript that run the source code directly is also related (and if you don't think people don't write complete applications in those you haven't seen any of the google apps). The big push for Java in 1998 could happen because the hardware was now fast enough to run _everything_ under an emulator for a processor that didn't actually exist (until Rockwell built one, anyway).

Build environments are now literally thousands of times faster than when I started programming. The first machine I compiled code on was a commodore 64 (1mhz, 8 bits, the compiler was called "blitz" and the best accelerator for it was a book). The slowest machine I ever ran Linux on was a 16 mhz 386sx.

According to my blog, I moved from a 166mhz laptop to a 266mhz one on April 13, 2002. I started building entire Linux From Scratch systems on the 166mhz machine, including a ton of optional packages (apache, postgresql, openssh, samba, plus it was based on glibc and coreutils and stuff back then so the build was _slow_), hence the necessity of scripting it and leaving the build to its own devices for a few hours.

Even without distcc calling out to the cross compiler, the emulated system running on my laptop is several times faster than the build environment I had 7 years ago (2001), somewhat faster than the one I had 5 years ago (2003), and somewhat slower than the one I had 3 years ago (2005). (That's emulating an x86 build environment on my x86_64 laptop. I didn't _have_ a non-x86 build enviornment 5 years ago for comparison purposes.)

Quoted 1 line

I think the progress is even bigger on big iron.

Not that I've noticed, unless by "big iron", you mean "PC clusters". (You can expand laterally if you've got the money for it and your problem distributes well...)

Quoted 2 lines

Also, how much of the 30000 packages are useful for something like your own firmware Linux?

None of them, because Firmware Linux has a strictly limited agenda: provide a native build environment on every system emulation supported by qemu. That's the 1.0 release criteria. (Some day I may add other emulators like hercules for s390, but the principle's the same.)

Once you have the native build environment, you can bootstrap Gentoo, or Debian, or Linux From Scratch, or whatever you like. I've got instructions for some of 'em.

The buildroot project fell into the trap of becoming a distro and having to care about the interaction between hundreds of packages. I'm not interested in repeating that mistake.

Figuring out what packages will other people might need is something I stopped trying to predict a long time ago. If it exists, somebody wanted it. People want/need the weirdest stuff: the accelerometer in laptops is used for rolling marble games, and the iPhone is a cell phone with 3D support for (among other things) video playback.

Quoted 10 lines
Quoted 3 lines

Distcc can take advantage of smp, but that won't help the ./configure stage and I need to do some work on distcc to teach it to understand more gcc

If you want to build 1000+ packages, you don't need to run configure itself multithreaded. There are enough jobs available to keep 16/32 processors busy (beyond that, you probably end up in inter-package-dependencies stalling the build). This is just a guess from what I see during a multi-threaded bake and multi-threaded make on OpenEmbedded.

If your package management system can work out the dependencies and launch the package builds in parallel, have at. Another reason I'm not trying to address package management: lots of people have already done it, and put a lot more work into it than I ever would. I'm just trying to help them do their thing while staying out of their way.

Quoted 5 lines
Quoted 3 lines

However, having one or more full-time engineers devoted to debugging cross-compile issues is quite a high price to pay too. Moore's law really doesn't help that one.

How about 30+ volunteers.

I presume you're referring to OpenEmbedded, rather than Gentoo Embedded, Debian Embedded, buildroot, openmoko, or any of the others?

Making cross compiling work is tied to your choice of package management systems. Making native compling work, less so. The point of my project is to _unbundle_ stuff. Separate out that layer, and make it as thin as possible.

Quoted 7 lines
Quoted 4 lines

I'm not saying either solution is perfect, I'm just saying the "build under emulation" approach is a viable alternative that gets more attractive as time passes, both because of ongoing development on emulators and because of Moore's law on the hardware.

I cannot follow your reasoning - Moore's law will help you more on the big iron side of things.

Actually it helps exactly as much, just on about a 5 year delay.

Moore's Law does not reduce the need for your above mentioned 30+ volunteers to endlessly debug cross compiling bugs.

My point is that building under emulation didn't used to be even _feasible_. Now it's an option. Building under an emulator in 2008 gives us about the speed of building natively around 2003, and that seemed tolerable at the time. Both the emulators and the hardware should improve going forward.

Quoted 3 lines

That said, I welcome any effort (such as yours) to help improve the embedded Linux domain, I rather try to fix the cross-compile stuff of the few thousand packages I am interested in.

I've gotten involved in too many big complicated projects that got sidelined by somebody figuring out how to substitute a simpler problem and solve that one instead. (Remember how much work maintaining kernel headers was before "make headers_install"?)

These days when I see big problem that can most obviously be solved by lots of people doing lots of work for a long time, my first instinct is try to figure out how to avoid needing to do that.

Quoted 1 line

Yes it hurts my brain.

It hurts everybody's brain.

There are two ways to build natively: you can do so under an emulator, or you can do so on real hardware.

The Fedora for Arm project builds natively, and started by using real ARM hardware to do it. (They've added qemu since; I note that the guy who runs that project used to be my boss back before we all left TimeSys.)
http://fedoraproject.org/wiki/Architectures/ARM#Technical_Approach

The Ubuntu for Arm project did the same, bought high end arm machines and made a compile farm out of them:
http://mojo.handhelds.org/files/HandheldsMojo_ELC2008.pdf

If you're going to throw money at the problem, you can get a lot of specialized native hardware to build on, and that's an option a number of large projects have been taking.

The advantage of using emulators is that it's cheaper and more flexible. Anybody can do it, it's just a build environment you can take with you on your laptop (no contention for a limited number of devices and your developers aren't tethered to them to get work/testing done). PC hardware is the cheapest and most flexible way to buy raw computing power (including memory/disk/network), and pretty much everybody already has it or they wouldn't be doing Linux development in the first place.

You don't snag hobbyists by saying "buy this hardware to play". You snag hobbyists by giving them something they can download and poke at with the lowest threshold possible, which is why I provide precompiled images ala
http://landley.net/code/firmware/downloads/system-image

Rob

Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.
#29 lore raw
In reply to Enrico Weigelt
Quoted 8 lines · On Thursday 12 June 2008 13:18:07 Enrico Weigelt wrote:

* Rob Landley <[email protected]> schrieb:

Hi,

Quoted 1 line

There's also qemu. You can native build under emulation.

did you ever consider that crosscompiling is not only good for some other arch, but a few more things ?

Sure, such as building a uClibc system on a glibc host, which my _previous_ firmware linux project (http://landley.net/code/firmware/old) was aimed at.

That used User Mode Linux instead of qemu, because "fakeroot" wasn't good enough and chroot A) requires the build to run as root, B) sometimes gets a little segfaulty if you build uClibc with newer kernel headers than the kernel in the system you're running on.

You can't get away from cross compiling whenever you want to bootstrap a new platform. But cross compiling can be minimized and encapsulated. It can be a stage you pass through to get it over with and no longer have to deal with it on the other side, which is the approach I take.

Quoted 6 lines
Quoted 4 lines

In addition, if you have a cross compiler but don't want to spend all your time lying to ./configure, preventing gcc from linking against the host's zlib or grabbing stuff out of /usr/include that your target hasn't got, or

#1: use a proper (sysroot'ed) toolchain

I break everything. (I've broken native toolchains. I just break them _less_.)

By my count sysroot is the fifth layer of path logic the gcc guys have added in an attempt to paint over the dry rot.

Personally I use a derivative of the old uClibc wrapper script that rewrites the command line to start with "--nostdinc --nostdlib" and then builds it back up again without having any paths in there it shouldn't.

Quoted 1 line

#2: fix broken configure.in's (and feed back to upstream or OSS-QM)

Whack-a-mole. Fun for the whole family. Only problem is, it never stops.

Quoted 1 line

#3: replace libtool by unitool

Uninstall libtool and don't replace it with anything, it's a NOP on Linux.

Quoted 5 lines
Quoted 2 lines

libraries are linked inside the emulator, anything that wants to look at /proc or sysinfo does it natively inside the emulator...)

Only crap sw looks at /proc at build time.
Yes, there's *much* crap sw out there :(

99% of all the developers out there don't really care about portability, and never will. Even if you eliminate the windows guys and the people who don't do C, 90% of the people who are _left_ get to work on the PC first, get it to work natively on other Linux platforms afterwards.

Cross compiling is a step beyond "portability". They'll _never_ care about cross compiling. If they get inspired to make it work on MacOS X, then you'll have to extract the source and _build_ it on MacOS X to make that work. And 99% of all developers will nod their heads and go "quite right, as it should be".

This isn't going to change any time soon.

Rob

Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.
#90 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Enrico Weigelt
Quoted 9 lines · On Thursday 12 June 2008 13:34:21 Enrico Weigelt wrote:
Quoted 3 lines · Bill Gatliff

If the build system derives from autoconf, then a hacked-up config.cache (or equivalent command-line args) often solves problems for me.

Only if you're working on *one specific* target for a long time. I, for example, have to support lots of different targets, so your approach does not work for me. Ah, and it's not *solving* any problem, just deferring it to some other day.

It's not deferring it, it's ripping out the failed automation and configuring it manually, answering each question by hand. (That said, it's the approach I took to get bash to cross-compile in FWL. Sometimes it's all you can do...)

Rob

Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.
#96 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Robert Schwebel

* Robert Schwebel <[email protected]> schrieb:

Hi,

Quoted 2 lines

Instead of hacking around and inventing new things, you should have spent your time for improving libtool ...

No, not with libtool.
I do not want to support that insane approach of tweaking command lines in the middle - it's an Pandorra's Box. I've already spent too much time on it and decided to completely drop it.

Instead I prefer *clean* lines.

Unitool provides commands on an higher level than, gcc+co do. These commands are on an higher functional level, hiding the individual platform's details. Also including things like importing .la-libs, sysroot, etc.

Lt-unitool is a wrapper which parses the libtool commands and calls Unitool to do the actual work.

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#158 lore raw

Re: cross-compiling alternatives

In reply to Bernd Petrovitsch
Quoted 3 lines · Bernd Petrovitsch
Quoted 1 line

Recent pkg-config supports sysroot.

FC-6 has "only" 0.21.

Not sure when the sysroot stuff got into upstream releaes, but maybe you just should update ;-P

Quoted 4 lines
Quoted 2 lines

So you simply build your .pc files as usual (w/o sysroot prefix) and set the sysroot prefix via env on the pkg-config call.

From a quick glance over the man page of 0.23, yes.

Yep, it doesn't take $SYSROOT (as my original patch did), but with some prefix ...

Quoted 5 lines

The problem is that the build-time (cross-)linker needs to find the (cross-compiled) lib under /my/build/host/target/environment/opt/foo/lib at link time and the shared linker under /opt/foo/lib at run-time. Hmm, after digging into that old project, it seems that libtool and the .la files were the problem.

Yes, libtool doesn't understand anything like sysroot. It generates broken pathnames in the .la files. You could use unitool and it's libtool-replacement.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Yes. And even worse the compiled lib "foo" had explicit dependencies (on lib "bar") on "/my/build/host/target/environment/opt/bar/lib/libbar.so.1.2.3.4".

And that's even more broken.

Yup. Maybe it was a result of my trial to make libtool work somehow ..

Heh, I've given up trying to repair libtool for a long time ;-P

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

And BTW pkg-config didn't support the concept of a "DESTDIR" variable (and I don't care about the name of that variable).

No, why should it ?! It does not install anything.

But it may "use" installed files.

Yes, but they have to be strictly from sysroot. As said, recent pkg-config can handle this properly.

Quoted 3 lines
Quoted 1 line

Probably you're looking for sysroot ?

Yes, very probably.

:)

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#139 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Jamie Lokier
Quoted 9 lines · Jamie Lokier
Quoted 6 lines
Quoted 4 lines

E.g. in python there are tests which call functions and check their result to see if we are currently on a platform where that function is broken (I think there was such a test for poll() and some other functions).

IMHO, that's broken sw engineering from ground up.

Oh? The alternative I see is to do the test at run-time. But that adds to executable size and run-time slowdown on most platforms.

There's no generic answer to this, we have to look at the details carefully ;-P

Most times I've seen those checks, they silently enable some features, eg. if it looks for certain kernel devices. Definitively the wrong way! It really should be in users/packagers control to explicitly enable features. Nevertheless, the existence of some file or device says nothing about whether it will be usable (or *should* be used) at runtime. I've seen packages silently enabling some feature and then failing at runtime since the previously detected device is missing later. What a nightamare for packagers.

Another point are broken syscalls. Well, you *have* check at runtime to be sure, or perhaps choose to ignore it and expect a sane system.

*If* you really want to do constraint checks, you should do it as an separate, optional step. Maybe issue a big-fat hint that one really should run that test (and follow certain instructions) if he don't exactly know what he's doing.

Quoted 2 lines

Doing it at build time is an improvement, for those people who don't care about cross-compilation. (Not me, you understand.)

IMHO, it's just lazyness, at least for about 99% of the cases ;-P

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#127 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Robert Schwebel
Quoted 10 lines · Robert Schwebel
Quoted 3 lines · Alexander Neundorf

Battle of Wesnoth is currently converted to both Scons and CMake, and in the end they will decide about the winner. (since Eric is good at arguing I guess it will be scons).

The thing is that 'configure && make && make install' plus the usuall --enable-foo / --disable-foo / --with-bla=blub semantics is simply *the* standard way of configuring stuff for unix systems. You don't need fancy tools, you get cross compiling almost for free and unix people simply know how to use it.

ACK. The ./configure script's syntax is quite convenient and semi-standard. So, IMHO, all packages which have such an configure stage should support that syntax, even those who code those scripts manually.
Strange, but some projects insist in having their config scripts incompatible with autoconf's, just to show that it wasn't produced by it ;-o

Quoted 3 lines

Been there, seen that. I maintain > 500 packets in PTXdist and guess which ones make 90% of the problems. Hint: they are not related to autotools ...

Well, if you count in the improber uses of autoconf (AC_TRY_RUN, etc),
then: yes.

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#125 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Jamie Lokier
Quoted 3 lines · Jamie Lokier

A trouble with that is some packages have hundreds of user-selectable options - or even thousands. It is unfeasible to use --enable-foo options for all of those when configuring then.

Well, not that much ;-o
But taking care of such feature switches is the job of an automated distro builder tool, including things like dependency tracking. Actually, I'm really too lazy for doing those stuff by hand ;-P

But you're right, some packages have too many optional features, which better should be their own packages, and there's sometimes much code out there which should be reused ...

Quoted 2 lines

Some other packages _should_ have more options, but don't because it's too unwieldy to make them highly configurable with Autoconf.

Adding new feature switches w/ autoconf is almost trivial (well, not completely ;-o)

Quoted 4 lines

Imho, Kconfig would be good for more programs than it's currently used for, and could be made to work with those --enable/--with options: you'd be able to configure them entirely on the command line, or interactively with "./configure --menu" (runs menuconfig), or with a config file.

Yes, that would be fine. But for me the primary constraint is that all switches/options can be specified by command line - otherwise I'd need extra complexity for each package in my distbuilder tool.

Quoted 3 lines

Perhaps it might even be possible to write a very small, portable, specialised alternative to Make which is small enough to ship with packages that use it?

No, I really wouldn't advise this. Make tools are, IMHO, part of the toolchain (in a wider sense). Once point is avoiding code duplication, but the really important one is: a central point of adaption/configuration. That's eg. why I like pkg-config so much:
if I need some tweaking, I just pass my own command (or a wrapper). If each package does it's library lookup completely by itself, I also need to touch each single package in case I need some tweaks. I had exactly that trouble w/ lots of packages, before I ported them to pkg-config.

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#115 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Jamie Lokier
Quoted 3 lines · Jamie Lokier

Media players with lots of optional formats and drivers are another. (They also have considerable problems with their Autoconf in my experience).

You probably mean their hand-written ./configure script, which is intentionally incompatible w/ autoconf ("this is not autoconf" as primary directive" ;-P) ... I guess we've got the same one in mind ;-)

Quoted 2 lines

Reality is that Kconfig front end to autotools does work - as you've proved. It's a good idea. :-)

Now, we just need an autoconf-alike frontend for Kconfig ;-)

Quoted 4 lines

Most packages need lots of additional libraries installed - and the development versions of those libraries, for that matter. Too often the right development version - not too recent, not too old. With the wrong versions, there are surprises.

But that's not the problem of autoconf or any other buildsystem, just bad engineering (often on both sides).

Quoted 3 lines

You said about too many user-selectable options. Many large packages _check_ for many installed libraries. Get them wrong, and you have the same problems of untested combinations.

It even gets worse when they silently enable certain features on presence/absence of some lib. That's btw one of the reasons why sysroot is an primary constraint for me, even when building for the platform+arch.

Quoted 3 lines

Have you felt uncomfortable shipping a package that does use Autoconf, Automake and Libtool, knowing that the scripts generated by those tools are huge compared with the entire source of your package?

Yeah, that's one of those things in autotools I never understood:
why isn't there just one function for each type of check/action, which is just called with the right params ?

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#159 lore raw

Re: cross-compiling alternatives

In reply to Enrico Weigelt
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Enrico" == Enrico Weigelt <[email protected]> writes:

Hi,

Quoted 3 lines · Enrico> * Bernd Petrovitsch <[email protected]> schrieb:
Quoted 3 lines
Quoted 1 line

Recent pkg-config supports sysroot.

FC-6 has "only" 0.21.

Notice that sysroot is broken in 0.23 (it removes everything else than -I / -L words). Patches have been posted to the pkgconfig list several times.

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

So you simply build your .pc files as usual (w/o sysroot prefix) and set the sysroot prefix via env on the pkg-config call.

From a quick glance over the man page of 0.23, yes.

Enrico> Yep, it doesn't take $SYSROOT (as my original patch did), but with Enrico> some prefix ...

PKG_CONFIG_SYSROOT_DIR

Signature · 1 line
Bye, Peter Korsgaard
#120 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Robert Schwebel

On Saturday 14 June 2008 01:19:32 you wrote:
...

Quoted 3 lines

I still don't understand why all the scons, cmakes and jams out there don't even try to provide the *standard* user interface everyone is used to on a unix system.

For cmake:
CMake has a cache, where the values of variables are stored, e.g. if an option is enabled or not, or where a library has been found (e.g. JPEG_LIBRARY=/usr/local/lib/libjpeg.so).
The way to influence the behaviour of cmake is to change the value of these variables, this can be done either via a GUI (curses based or with cmake 2.6 also a graphical one), or via the command line:

$ cmake -D<name_of_variable>=<new_value> ...more options

There is no simple automatic mapping from the variables to enabling features.

Anyway, it is on the TODO for cmake to add some kind of support for project-configurable command line options, so that configure-compatible options could be provided.

Quoted 4 lines
Quoted 2 lines

Lots of packages need special tools or other software installed to build them; this is no different.

autotools need only a shell and make

Yes, and requiring a shell is a lot, in the case you want to port also to Windows.

Alex

#63 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Enrico Weigelt

On Friday 13 June 2008 16:51:19 Enrico Weigelt wrote:
...

Quoted 5 lines

That's why I prefer an purely descriptive paragidm (= subset of delcarative, but practically no logic): a buildfile should only describe the package's structure (eg.: "i have some executable foo which consists of source [...] and imports libs [...]), so the buildtool (and user's config) can cope with it all.

This was also the plan for cmake when it was started. But it turned out that this is not enough, and for more complex projects some programming logic is required. So cmake turned from quite declarative to quite imperative over time.
So while declarative sounds nice, in practice it just isn't powerful enough.

Alex

#97 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Enrico Weigelt
Quoted 14 lines · On Monday 16 June 2008 01:12:41 Enrico Weigelt wrote:

* Robert Schwebel <[email protected]> schrieb:

Hi,

Quoted 2 lines

Instead of hacking around and inventing new things, you should have spent your time for improving libtool ...

No, not with libtool.
I do not want to support that insane approach of tweaking command lines in the middle - it's an Pandorra's Box. I've already spent too much time on it and decided to completely drop it.

Instead I prefer *clean* lines.

Quoted 7 lines

Unitool provides commands on an higher level than, gcc+co do. These commands are on an higher functional level, hiding the individual platform's details. Also including things like importing .la-libs, sysroot, etc.

Lt-unitool is a wrapper which parses the libtool commands and calls Unitool to do the actual work.

Seriously, why is a wrapper for the compiler/linker required AT ALL if the calls to these tools are made from _generated_ files ?
The generated files should just contain the appropriate calls for the respective commands.
This layer of abstraction is unnecessary and IMO just adds confusion. (modifying libtool so that it calls unitool even seems to add yet another layer which can potentially break or bitrot etc.)

Alex

#128 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Robert Schwebel

On Friday 13 June 2008 20:51:57 you wrote:
...

Quoted 3 lines

Been there, seen that. I maintain > 500 packets in PTXdist and guess which ones make 90% of the problems. Hint: they are not related to autotools ...

If there are specific problems common to many cmake based packages please report that to [email protected]. If there is something many people get wrong something should be done about this in cmake (and if it just means improving the documentation).

Alex

#129 lore raw

Re: cross-compiling alternatives

In reply to Robert Schwebel
Quoted 10 lines · Robert Schwebel
Quoted 3 lines · Alexander Neundorf

Battle of Wesnoth is currently converted to both Scons and CMake, and in the end they will decide about the winner. (since Eric is good at arguing I guess it will be scons).

The thing is that 'configure && make && make install' plus the usuall --enable-foo / --disable-foo / --with-bla=blub semantics is simply *the* standard way of configuring stuff for unix systems. You don't need fancy tools, you get cross compiling almost for free and unix people simply know how to use it.

As long as people avoid AC_TRY_RUN() and similar and allow the "configurator" to tell configure.sh facts for the unavoidable cases about the target (and there were some apps - and I forgot the names - out there where this wasn't easily possible with editing the generated configure.sh. Yes, that's not fault of autotools as such but autotools make it IMHO far too easy to write that sort without generating lots of warnings[0]).

Quoted 2 lines

All the cool kids out there who think they know everything better usually start with "I hate autotools", then invent something which

That has IMHO 2 main reasons:
- For lost of apps, a Makefile and some coding discipline is more than enough to support Linux/*BSD/MacOS-X even on different hardware. And there are always cases where you need OS-specific code anyways (e.g. manipulating routes).
Yes, that may need much more coding discipline than the average programmer is used to.
- Converting $PROJECT to autotools is not easy. One has to learn and understand how the tools work[1] and what should be done in which way. And AFAIU (which is not much for autotools) one has to adapt the source anyways here and there (so it is not really a drop-in replacement).
And if people consider using autotools, it is probably quite large and complex ....

Add that to negative experiences with other autotools packages and I can understand the above sentence.

Quoted 2 lines

solves 0.1% of the problems (including their very special problem) and tell the rest of the world that their shiny new tools is *soooo cooool*.

Bernd

[0]: Yes, this is free software and I could send patches etc. to fix
that. But that price is IMHO higher than just not using autotools for new stuff.
[1]: And I didn't find a site yet with an easy understandable
description for seasoned programmers with cross-compile and multi-hardware experience.

Signature · 3 lines
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services
#98 lore raw

Re: cross-compiling alternatives

In reply to Alexander Neundorf

On Mon, 2008-06-16 at 10:02 +0200, Alexander Neundorf wrote:
[...]

Quoted 2 lines

Seriously, why is a wrapper for the compiler/linker required AT ALL if the calls to these tools are made from _generated_ files ?

AFAIU the motivation of libtool to provide OS-independent (and toolchain independent?) means to compile and link (etc.).

Quoted 2 lines

The generated files should just contain the appropriate calls for the respective commands.

But these calls are - e.g. for shared libraries - not identical. The Gnu toolchain is not everything.

Quoted 3 lines

This layer of abstraction is unnecessary and IMO just adds confusion. (modifying libtool so that it calls unitool even seems to add yet another layer which can potentially break or bitrot etc.)

I know of more than one "occasion" where "gcc" et.al. actually where wrappers around the actually binaries to check and guarantee commandline parameters and options (some must be there, some mustn't be there, ...). Usually sane Makefiles (and sane autotools usages) are enough for that.

Bernd

Signature · 3 lines
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services
#117 lore raw

Re: cross-compiling alternatives

In reply to Jamie Lokier

On Sam, 2008-06-14 at 01:07 +0100, Jamie Lokier wrote:
[...]

Quoted 1 line

You said about too many user-selectable options. Many large packages

These are IME not a problem if they have somewhat sensible defaults.

Quoted 2 lines

_check_ for many installed libraries. Get them wrong, and you have the same problems of untested combinations.

As long as I can specify that libfoo support must be compiled in (and thus libfoo must be present) and the tools throw an error if it doesn't find it, I have no problem.
Otherwise all package builders have a serious problem.

Bernd

Signature · 3 lines
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services
#99 lore raw

Re: cross-compiling alternatives

In reply to Bernd Petrovitsch
Quoted 6 lines · On Monday 16 June 2008 10:28:30 Bernd Petrovitsch wrote:

On Mon, 2008-06-16 at 10:02 +0200, Alexander Neundorf wrote:
[...]

Quoted 2 lines

Seriously, why is a wrapper for the compiler/linker required AT ALL if the calls to these tools are made from _generated_ files ?

Quoted 8 lines

AFAIU the motivation of libtool to provide OS-independent (and toolchain independent?) means to compile and link (etc.).

Quoted 2 lines

The generated files should just contain the appropriate calls for the respective commands.

But these calls are - e.g. for shared libraries - not identical. The Gnu toolchain is not everything.

Yes, that's what I mean. The commands for calling the tools are generated. They should be generated appropriately for the respective toolchains (i.e. the generator must know how to call the different toolchains). No libtool/unitool/other wrappers required.

Alex

#140 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Enrico Weigelt
Quoted 3 lines · Enrico Weigelt

Most times I've seen those checks, they silently enable some features, eg. if it looks for certain kernel devices. Definitively the wrong way!

Agreed. Though, you do often have to check for headers etc., otherwise you won't have the definitions needed to work with those devices. (Think: inotify).

Quoted 2 lines

It really should be in users/packagers control to
explicitly enable features.

But then there's a problem with 100 or more --enable-foo command line options. The user's script will _calls_ ./configure will bitrot... there's no way you'll be typing it on the command line.

A big package can easily depend on that many local features.

Quoted 5 lines

Nevertheless, the existence of some file or device says nothing about whether it will be usable (or *should* be used) at runtime. I've seen packages silently enabling some feature and then failing at runtime since the previously detected device is missing later. What a nightamare for packagers.

I agree, assume they're all there is not sane.

Quoted 2 lines

Another point are broken syscalls. Well, you *have* check at runtime to be sure, or perhaps choose to ignore it and expect a sane system.

That said, to use rsync as an example. It uses the utimes() system call when available, and utime() otherwise, because the former is better.

On current GNU/Linux it will use utimes(). Recently someone tried to run it on an old kernel, and it failed. If it tried utimes() first then fell back to utime(), it was fine, and rsync has a patch to do that now.

But here's the thing: do you really want every package have code calling every different variation on a system call, at run time, until it finds one that works?

-- Jamie

#141 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

Quoted 3 lines · Jamie Lokier

But here's the thing: do you really want every package have code calling every different variation on a system call, at run time, until it finds one that works?

No. That functionality lives in libc, if you want it at all.

Signature · 1 line
dwmw2
#118 lore raw

Re: cross-compiling alternatives

In reply to Bernd Petrovitsch
Quoted 7 lines · Bernd Petrovitsch
Quoted 2 lines

_check_ for many installed libraries. Get them wrong, and you have the same problems of untested combinations.

As long as I can specify that libfoo support must be compiled in (and thus libfoo must be present) and the tools throw an error if it doesn't find it, I have no problem.
Otherwise all package builders have a serious problem.

They do have problems, when you want to repeatably build and deploy, if the build environment isn't very similar each time.

Typically the way you specify that libfoo support must be compiled in is --with-libfoo=/path/to/libfoo.

That way lies bitrot between your build script which calls ./configure (since you won't by typing it manually with 20+ options like that each time you rebuild), and the changing version of an upstream package you configure.

To prevent it trying to compile in libs you don't want, you also need --without-libfoo. Using Kerberos as an example, which I remember when building CVS ages ago: If you don't _prevent_ it using libraries you don't want, you get different binariesn depending on whether a Kerberos library was installed on the build system at build time. You might then send a built program to another system, and find it won't run at all, or has unwanted behaviour.

Do you really see package building scripts with 20 --with-libfoo= and --without-libfoo= options in them for every library? Sometimes. But more often, not: instead, they more often have build-time installed prerequisites.

-- Jamie

#116 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Enrico Weigelt
Quoted 4 lines · Enrico Weigelt
Quoted 2 lines

Reality is that Kconfig front end to autotools does work - as you've proved. It's a good idea. :-)

Now, we just need an autoconf-alike frontend for Kconfig ;-)

I agree and would support:

./configure --menu
Invokes a configuration menu / wizard for user-selectable options. Only works if you have the "autoconf-menu" tools already installed.

./configure --ask
Invokes command line configuration questions / wizard for user-selectable options.

./configure --ask --from-config=OLDCONFIG
Uses existing settings from a previous configuration.

./configure
Without --menu or --ask, invokes traditional Autoconf automatic detection of capabilities.

Quoted 8 lines
Quoted 3 lines

You said about too many user-selectable options. Many large packages _check_ for many installed libraries. Get them wrong, and you have the same problems of untested combinations.

It even gets worse when they silently enable certain features on presence/absence of some lib. That's btw one of the reasons why sysroot is an primary constraint for me, even when building for the platform+arch.

That's a basic design feature of Autoconf. And it really is very good most of the time - much better than config scripts which ask a lot of questions (Perl).

Quoted 7 lines
Quoted 3 lines

Have you felt uncomfortable shipping a package that does use Autoconf, Automake and Libtool, knowing that the scripts generated by those tools are huge compared with the entire source of your package?

Yeah, that's one of those things in autotools I never understood:
why isn't there just one function for each type of check/action, which is just called with the right params ?

It's because it's written in very portable Bourne shell, which does not support shell functions.

(This is why I toy with the idea of writing a very portable C program, similar to a simplified shell, specially designed for Autoconf, with functions...)

It could simulate functions portably by creating lots of little scripts at the start, and then calling them later on. That would shrink ./configure a lot. But it's a big change; somebody's got to do it, test it, look after it, and so on.

Libtool similarly does not have to be huge, but it would be a lot of work to shrink it without breaking anything. It's hard enough to change it at all without breaking anything on some system, somewhere.

-- Jamie

#109 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Robert Schwebel
Quoted 10 lines · Robert Schwebel

We have once tried to write our automated test system for embedded boards with python and xml; the idea was to have something fancy, new and with good code-reuse. In the end it failed because the pexpect package we used to do the pattern matching bitrotted so quickly that four months later all the fancy tests didn't work any more, because it is not part of the python core.

In the meantime we have migrated our automatic testing stuff to use shell, ssh/rsh and kermit. It is rock solid, and the code reuse factor is at least as good as with anything else.

It sounds like the basic problem there was using non-core Python. You can count on shell, ssh/rsh, kernel - they're stable. You can count on Pythong's core language. But not on pexpect: if you depended on that, you should probably have copied the code into your own test system, or written an equivalent. Easier said than done, I know.

Quoted 5 lines
Quoted 3 lines

Have you felt uncomfortable shipping a package that does use Autoconf, Automake and Libtool, knowing that the scripts generated by those tools are huge compared with the entire source of your package?

No :-)

It's really disturbed me, sometimes, shipping a package of 50kB source and 2MB configure+libtool.

Quoted 8 lines
Quoted 1 line

Have you _written_ Autoconf tests recently?

Yea, all our packages are autotoolized.

Quoted 1 line

Made any shell / shellutils non-portability mistakes in the tests?

Yea, it happens in ptxdist all the time. People report about problems, we add new tests and the next revision works even on Ubuntu :)

Right, so you have no idea about portability of your tests on, say, SCO Unixserver or IRIX? :-)

Quoted 4 lines

I have no problems with people writing fancy new things. It's just that most people who try to do something better than autotools have only a fraction of the features.

Quoted 8 lines

Open Source is darwinism: if there is something better, let's use it. But compare apples with apples.

Quoted 3 lines

If you're going to rewrite Autotools using GNU Make, why not ask if another tool would be better, perhaps a tool specially designed for the job?

Go ahead.

The first part of going ahead is to brainstorm and find ideas and likely interest... It's too big (as you rightly note) to simply sit down and do it by oneself in isolation.

-- Jamie

#119 lore raw

Re: cross-compiling alternatives

In reply to Jamie Lokier
Quoted 11 lines · Jamie Lokier
Quoted 7 lines · Bernd Petrovitsch
Quoted 2 lines

_check_ for many installed libraries. Get them wrong, and you have the same problems of untested combinations.

As long as I can specify that libfoo support must be compiled in (and thus libfoo must be present) and the tools throw an error if it doesn't find it, I have no problem.
Otherwise all package builders have a serious problem.

They do have problems, when you want to repeatably build and deploy, if the build environment isn't very similar each time.

Sometimes you have a different build environments - if only that you want to rebuild e.g. your .src.rpm on several versions of CentOS and Fedora.

Quoted 4 lines

Typically the way you specify that libfoo support must be compiled in is --with-libfoo=/path/to/libfoo.

That way lies bitrot between your build script which calls ./configure

Cannot be really avoided IMHO.

Quoted 3 lines

(since you won't by typing it manually with 20+ options like that each time you rebuild), and the changing version of an upstream package you configure.

So be it. At least one sees errors/bugs immediately.

Quoted 10 lines

To prevent it trying to compile in libs you don't want, you also need --without-libfoo. Using Kerberos as an example, which I remember when building CVS ages ago: If you don't _prevent_ it using libraries you don't want, you get different binariesn depending on whether a Kerberos library was installed on the build system at build time. You might then send a built program to another system, and find it won't run at all, or has unwanted behaviour.

Do you really see package building scripts with 20 --with-libfoo= and --without-libfoo= options in them for every library? Sometimes. But

For (in an ideal world 100%) repeatable builds - for a .rpm. .deb, some cross-compiled embedded device - one usually ends up with that explicit list (and IMHO it's the smaller PITA than to cope with strange bug reports because something was broken in the build weeks ago). Mainly because the dependency information is also present elsewehre (e.g. in the package). Or you really want control over the installed software.

Quoted 2 lines

more often, not: instead, they more often have build-time installed prerequisites.

Bernd

Signature · 3 lines
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services
#126 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Enrico Weigelt
Quoted 8 lines · Enrico Weigelt
Quoted 4 lines

Imho, Kconfig would be good for more programs than it's currently used for, and could be made to work with those --enable/--with options: you'd be able to configure them entirely on the command line, or interactively with "./configure --menu" (runs menuconfig), or with a config file.

Yes, that would be fine. But for me the primary constraint is that all switches/options can be specified by command line - otherwise I'd need extra complexity for each package in my distbuilder tool.

Yes, I agree with that. It's one of the nice things about Kconfig that you can use it with pre-specific config files, even when the config is from a different version and doesn't specify everything. Doing so as ./configure --enable/--disable arguments seems like a comfortable fit.

Quoted 5 lines
Quoted 4 lines

Perhaps it might even be possible to write a very small, portable, specialised alternative to Make which is small enough to ship with packages that use it?

Quoted 9 lines

No, I really wouldn't advise this. Make tools are, IMHO, part of the toolchain (in a wider sense). Once point is avoiding code duplication, but the really important one is: a central point of adaption/configuration. That's eg. why I like pkg-config so much:
if I need some tweaking, I just pass my own command (or a wrapper). If each package does it's library lookup completely by itself, I also need to touch each single package in case I need some tweaks. I had exactly that trouble w/ lots of packages, before I ported them to pkg-config.

That's interesting, thanks. I have seen problems with pkg-config, but adding your own wrapper is a nice way to fix any of them :-)

That said, if you can specify library lookup on the ./configure command line, that fixes a lot of problems of repeatability too.

Only problem then is you don't always know _which_ options to pass on the ./configure command line, if you have a package build script, and a different version of the package. There's a tendancy to drift apart which manifests as silent mistakes, until some user reports a bug.

-- Jamie

#142 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to David Woodhouse
Quoted 6 lines · David Woodhouse
Quoted 3 lines · Jamie Lokier

But here's the thing: do you really want every package have code calling every different variation on a system call, at run time, until it finds one that works?

No. That functionality lives in libc, if you want it at all.

Sometimes that's ok.

But sometimes libc can't do that, because the point of a newer function is it addresses some inadequacy of an old function. If libc does a "compatibility" thing and uses old syscalls on old kernels, sometimes that introduces bugs.

E.g. Calls to pread should _not_ be implemented as lseek+read+lseek on old kernels which don't have pread. That leads to race conditions and corruption in some applications. (I think this has really occurred, but I'm unable to find it now).

The same applications are fine if pread returns ENOSYS and they know what they need to do with lseek and read.

The same is true of the rsync example, with utimes and utime. It's wrong for libc to "emulate" utimes using utime on old kernels: they aren't the same. So the application does it instead: the application has a policy that it's fine with the different functionality when utimes returns ENOSYS.

-- Jamie

#143 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

Quoted 4 lines · Jamie Lokier

E.g. Calls to pread should _not_ be implemented as lseek+read+lseek on old kernels which don't have pread. That leads to race conditions and corruption in some applications. (I think this has really occurred, but I'm unable to find it now).

Likewise pselect(). You're right -- it can't always be emulated.

Signature · 1 line
dwmw2
#110 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Jamie Lokier

On Monday 16 June 2008 13:39:46 you wrote:
...

Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

If you're going to rewrite Autotools using GNU Make, why not ask if another tool would be better, perhaps a tool specially designed for the job?

Go ahead.

The first part of going ahead is to brainstorm and find ideas and likely interest... It's too big (as you rightly note) to simply sit down and do it by oneself in isolation.

You are not seriously talking about writing yet another buildsystem ? With autotools, cmake, scons, ant, (b)jam, bitbake, makeng, etc. there should be enough available.

Alex

#111 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

Quoted 8 lines · Alexander Neundorf

On Monday 16 June 2008 13:39:46 you wrote:
...

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

If you're going to rewrite Autotools using GNU Make, why not ask if another tool would be better, perhaps a tool specially designed for the job?

Go ahead.

Quoted 7 lines
Quoted 3 lines

The first part of going ahead is to brainstorm and find ideas and likely interest... It's too big (as you rightly note) to simply sit down and do it by oneself in isolation.

You are not seriously talking about writing yet another buildsystem? With autotools, cmake, scons, ant, (b)jam, bitbake, makeng, etc. there should be enough available.

No, I'm talking about improving Autotools to handle some things better than they do now. Passing the high hurdles required to become part of Autotools - especially compatibility - is part of the goal.

-- Jamie

#160 lore raw

Re: cross-compiling alternatives

In reply to Peter Korsgaard

* Peter Korsgaard <[email protected]> schrieb:

Hi,

Quoted 3 lines

Notice that sysroot is broken in 0.23 (it removes everything else than -I / -L words). Patches have been posted to the pkgconfig list several times.

ugh, why didn't they just apply my patch which only appends $sysroot to the pathes ? .... grmpf ...

well, i'll stick w/ my 5-lines wrapper script ;-o

Quoted 4 lines

Enrico> Yep, it doesn't take $SYSROOT (as my original patch did), but with Enrico> some prefix ...

PKG_CONFIG_SYSROOT_DIR

ack.

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#121 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Alexander Neundorf
Quoted 7 lines · Alexander Neundorf

CMake has a cache, where the values of variables are stored, e.g. if an option is enabled or not, or where a library has been found (e.g. JPEG_LIBRARY=/usr/local/lib/libjpeg.so).
The way to influence the behaviour of cmake is to change the value of these variables, this can be done either via a GUI (curses based or with cmake 2.6 also a graphical one), or via the command line:

$ cmake -D<name_of_variable>=<new_value> ...more options

Are these variables strictly specified or is all left to individual author's decision ?

Quoted 4 lines
Quoted 1 line

autotools need only a shell and make

Yes, and requiring a shell is a lot, in the case you want to port also to Windows.

hmm, why not just expecting an sane shell on the building system ? (as you already have to expect a sane compiler)

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#64 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Alexander Neundorf
Quoted 10 lines · Alexander Neundorf
Quoted 5 lines

That's why I prefer an purely descriptive paragidm (= subset of delcarative, but practically no logic): a buildfile should only describe the package's structure (eg.: "i have some executable foo which consists of source [...] and imports libs [...]), so the buildtool (and user's config) can cope with it all.

This was also the plan for cmake when it was started. But it turned out that this is not enough, and for more complex projects some programming logic is required. So cmake turned from quite declarative to quite imperative over time.

And so you just open the Pandorra's Box again ;-o
As soon as you try to build some one-fits-all-solution, you'll sooner or later run into similar problems as autoconf has.

I won't to that w/ my TreeBuild. It is intentionally limited on easily structured packages. People should either structure their packages properly use something else ;-P

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#112 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Jamie Lokier
Quoted 3 lines · Jamie Lokier

No, I'm talking about improving Autotools to handle some things better than they do now. Passing the high hurdles required to become part of Autotools - especially compatibility - is part of the goal.

If you look at the sh scripts generated by autotools one is tempted to just ship a small, clean sh, written in C89 with autotools, use that and drop the workarounds.

#144 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Jamie Lokier
Quoted 2 lines · Jamie Lokier

The same applications are fine if pread returns ENOSYS and they know what they need to do with lseek and read.

Note that they (pread, etc.) would better not exist at all instead of being stubbed out (this requirement was dropped, AFAICS). If there is no prototype then you don't need AC_TRY_RUN(other_arch_pread_test) in the first place. Of course this assumes that you don't want to make that decision at runtime but compile time.

Quoted 6 lines

The same is true of the rsync example, with utimes and utime. It's wrong for libc to "emulate" utimes using utime on old kernels: they aren't the same. So the application does it instead: the application has a policy that it's fine with the different functionality when utimes returns ENOSYS.

You usually do the opposite, emulate utimes with utime ;) link_warning(utimes, "the use of LEGACY utimes' is discouraged, use utime'")

#161 lore raw

Re: cross-compiling alternatives

In reply to Enrico Weigelt
Quoted 7 lines · Enrico Weigelt

* Peter Korsgaard <[email protected]> schrieb:

Hi,

Quoted 3 lines

Notice that sysroot is broken in 0.23 (it removes everything else than -I / -L words). Patches have been posted to the pkgconfig list several times.

heh, so it keeps e.g. -I=/usr/include ? Fun ;)

#65 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Enrico Weigelt
Quoted 13 lines · Enrico Weigelt
Quoted 10 lines · Alexander Neundorf
Quoted 5 lines

That's why I prefer an purely descriptive paragidm (= subset of delcarative, but practically no logic): a buildfile should only describe the package's structure (eg.: "i have some executable foo which consists of source [...] and imports libs [...]), so the buildtool (and user's config) can cope with it all.

This was also the plan for cmake when it was started. But it turned out that this is not enough, and for more complex projects some programming logic is required. So cmake turned from quite declarative to quite imperative over time.

Quoted 7 lines

And so you just open the Pandorra's Box again ;-o
As soon as you try to build some one-fits-all-solution, you'll sooner or later run into similar problems as autoconf has.

I won't to that w/ my TreeBuild. It is intentionally limited on easily structured packages. People should either structure their packages properly use something else ;-P

For simple packages autoconf+automake+libtool is already near at your descriptive paragidm.

And despite all nasty details of autoconf/automake/libtool they also have advantages:
- they are quite powerful when you know how to handle them
- they allow to build your software on non-Linux systems
- they are the de-facto standard in the open source world, and everyone building open source software knows them

And the last point is a very important one:

For me as someone who is often compiling software your plan of creating yet another build tool I have to handle does not sound like a good idea.

Quoted 1 line

cu

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#113 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Bernhard Fischer
Quoted 9 lines · Bernhard Fischer
Quoted 3 lines · Jamie Lokier

No, I'm talking about improving Autotools to handle some things better than they do now. Passing the high hurdles required to become part of Autotools - especially compatibility - is part of the goal.

If you look at the sh scripts generated by autotools one is tempted to just ship a small, clean sh, written in C89 with autotools, use that and drop the workarounds.

Exactly!

Use an early, small Autoconf script written in very portable shell (as now) to detect the small set of features needed for this "clean sh", and a host compiler. Then build it, then continue in clean sh.

But if you're doing that, why use sh? It could be a subset of sh with extensions especially for this job - or something else entirely - to make Autoconf scripts cleaner, smaller, faster than they are now. Or even a tokenised sh, so Autoconf tests run directly on it but are compact. Possibly even _more_ portable (no need to depend on quirks of some utilities; configure scripts more checkable for common errors). And easier to configure things on environments with no shell (i.e. Windows).

It adds an extra requirement for a host C compiler, but that's probably reasonable these days.

This conversation ought to be heading over to the autotools lists... if anyone wants to take it up there.

-- Jamie

#114 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

Quoted 26 lines · Jamie Lokier
Quoted 9 lines · Bernhard Fischer
Quoted 3 lines · Jamie Lokier

No, I'm talking about improving Autotools to handle some things better than they do now. Passing the high hurdles required to become part of Autotools - especially compatibility - is part of the goal.

If you look at the sh scripts generated by autotools one is tempted to just ship a small, clean sh, written in C89 with autotools, use that and drop the workarounds.

Exactly!

Use an early, small Autoconf script written in very portable shell (as now) to detect the small set of features needed for this "clean sh", and a host compiler. Then build it, then continue in clean sh.

But if you're doing that, why use sh? It could be a subset of sh with extensions especially for this job - or something else entirely - to make Autoconf scripts cleaner, smaller, faster than they are now. Or even a tokenised sh, so Autoconf tests run directly on it but are compact. Possibly even _more_ portable (no need to depend on quirks of some utilities; configure scripts more checkable for common errors). And easier to configure things on environments with no shell (i.e. Windows).

Quoted 5 lines

It adds an extra requirement for a host C compiler, but that's probably reasonable these days.

This conversation ought to be heading over to the autotools lists... if anyone wants to take it up there.

All public ramblings about how autoconf might be improved don't bring anything if you do not implement your ideas yourself and show that your implementation is better than the status quo.

After all, open source development is not driven by people producing hot air but by people writing code...

Quoted 1 line

-- Jamie

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#122 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Enrico Weigelt
Quoted 11 lines · On Monday 16 June 2008 17:15:37 Enrico Weigelt wrote:
Quoted 7 lines · Alexander Neundorf

CMake has a cache, where the values of variables are stored, e.g. if an option is enabled or not, or where a library has been found (e.g. JPEG_LIBRARY=/usr/local/lib/libjpeg.so).
The way to influence the behaviour of cmake is to change the value of these variables, this can be done either via a GUI (curses based or with cmake 2.6 also a graphical one), or via the command line:

$ cmake -D<name_of_variable>=<new_value> ...more options

Are these variables strictly specified or is all left to individual author's decision ?

Authors decision.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

autotools need only a shell and make

Yes, and requiring a shell is a lot, in the case you want to port also to Windows.

hmm, why not just expecting an sane shell on the building system ? (as you already have to expect a sane compiler)

Well, we could go so far to expect a "sane" operating system, but you can't change it, there are "insane" people in the world ;-)

Alex

#123 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

Quoted 10 lines · Alexander Neundorf
Quoted 9 lines · On Monday 16 June 2008 17:15:37 Enrico Weigelt wrote:
Quoted 7 lines · Alexander Neundorf

CMake has a cache, where the values of variables are stored, e.g. if an option is enabled or not, or where a library has been found (e.g. JPEG_LIBRARY=/usr/local/lib/libjpeg.so).
The way to influence the behaviour of cmake is to change the value of these variables, this can be done either via a GUI (curses based or with cmake 2.6 also a graphical one), or via the command line:

$ cmake -D<name_of_variable>=<new_value> ...more options
Quoted 4 lines
Quoted 2 lines

Are these variables strictly specified or is all left to individual author's decision ?

Authors decision.

Then you've got the same problem as w/ autoconf's config.status:
You have to tweak it for each individual package separately :(

My destiny is to have strictly standardized variables for all the common things, so you can use an global per-target configuration for *all* packages ever coming.
That's what Unitool's system properties db is for.

Quoted 5 lines
Quoted 2 lines

hmm, why not just expecting an sane shell on the building system ? (as you already have to expect a sane compiler)

Well, we could go so far to expect a "sane" operating system, but you can't change it, there are "insane" people in the world ;-)

Many, many things can be done within in the toolchain, eg. fixes for broken libc's. For example, I've seen packages adding several missing functions for certain platforms - this should be the job of the toolchain.

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#66 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Adrian Bunk

* Adrian Bunk <[email protected]> schrieb:

Hi,

Quoted 6 lines
Quoted 3 lines

I won't to that w/ my TreeBuild. It is intentionally limited on easily structured packages. People should either structure their packages properly use something else ;-P

For simple packages autoconf+automake+libtool is already near at your descriptive paragidm.

Yes, but mine is much simpler and syntactically stable. With autotools there are uncountable things you can do wrong, without even noticing - it needs *very* much care. In TreeBuild there's almost no room for those mistakes. A simple typo can lead autoconf to unpredictable behaviour - TreeBuild spits out an parse error.

So for these cases (which already make up a very large number of total packages in the world), maintaining buildfiles becomes a lot easier ;-P

Quoted 3 lines

And despite all nasty details of autoconf/automake/libtool they also have advantages:
- they are quite powerful when you know how to handle them

The point is: you *must* know autotools very well, otherwise you soon run into pitfalls.

Quoted 1 line

- they allow to build your software on non-Linux systems

TreeBuild does that too, as soon as someone wrote a proper config for another platform. The design is platform agnostic, just lacking ports to other platforms, due lack of (my) time.

Quoted 2 lines

- they are the de-facto standard in the open source world, and everyone building open source software knows them

I don't think that this is a good argument. M$-Word is also an "de facto" standard ;-P

Quoted 4 lines

And the last point is a very important one:

For me as someone who is often compiling software your plan of creating yet another build tool I have to handle does not sound like a good idea.

Yes, but that's not a problem of TreeBuild, but the total count of different build systems around the world. That's why a new buildsystem should be an really good solution for an reasonable class of problems and should be easy to learn. IMHO, TreeBuild does this - for simple structed packages. (which make up about 99% of my own ones).

Of course, TreeBuild still in an early development stage. So I don't claim it's really usable for everyone - for now it's more an academic issue.

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#30 lore raw
In reply to Rob Landley

* Rob Landley <[email protected]> schrieb:

Hi,

Quoted 4 lines

You can't get away from cross compiling whenever you want to bootstrap a new platform. But cross compiling can be minimized and encapsulated. It can be a stage you pass through to get it over with and no longer have to deal with it on the other side, which is the approach I take.

That's not enought for me. I want more encapsulation (yes, but buildfarm is also running in a VZ, but still sysroot'ed). For example, I *want* certain tests (like running target code) to fail, since I *do not* trust them. (btw: I also let compiler warnings fail, just to be sure).

I, personally, prefer high build-time constraints, because runtime tests are quite limited.

Quoted 2 lines

By my count sysroot is the fifth layer of path logic the gcc guys have added in an attempt to paint over the dry rot.

I see this as a quite good separation between running and target system, just one more fence for clear borders. As long as you don't pass absolute search pathes to it, you can be sure that it doesn't mix up target and host.

Actually, I never want to crosscompile w/o it.

Quoted 3 lines

Personally I use a derivative of the old uClibc wrapper script that rewrites the command line to start with "--nostdinc --nostdlib" and then builds it back up again without having any paths in there it shouldn't.

Might work, but then you're limited to some specific cases. If you *only* intent bootstrapping of an minimal system, fine, but for my projects too complex to handle.

Quoted 3 lines
Quoted 1 line

#2: fix broken configure.in's (and feed back to upstream or OSS-QM)

Whack-a-mole. Fun for the whole family. Only problem is, it never stops.

Most times, it as only to be done one per package. And it's an clean solution.

Quoted 3 lines
Quoted 1 line

#3: replace libtool by unitool

Uninstall libtool and don't replace it with anything, it's a NOP on Linux.

The problem is: many packages are entirely built upon this. So you'll have to de-libtoolize them. Very much work. As I already had Unitool, I preferred investing just a few hours for creating an generic drop-in replacement for libtool instead of touching each single package.

Quoted 7 lines
Quoted 2 lines

Only crap sw looks at /proc at build time.
Yes, there's *much* crap sw out there :(

99% of all the developers out there don't really care about portability, and never will. Even if you eliminate the windows guys and the people who don't do C, 90% of the people who are _left_ get to work on the PC first, get it to work natively on other Linux platforms afterwards.

True :(
Some packages out there even don't have an clean native build path, eg. requiring parts of the package already built and installed (-> firebird-db)

Quoted 7 lines

Cross compiling is a step beyond "portability". They'll _never_ care about cross compiling. If they get inspired to make it work on MacOS X, then you'll have to extract the source and _build_ it on MacOS X to make that work. And 99% of all developers will nod their heads and go "quite right, as it should be".

This isn't going to change any time soon.

Actually, I don't care much about that. I concentrate on getting those packages I need cleaned-up and crosscompile'able - even if this means going alone and maintaining an own branch.

If I sum up all the invested working hours of all the last years on that and substract the total saved time from other projects where I'm reusing this work, I get a positive balance ;-P

cu

Signature · 8 lines
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------
#124 lore raw

Re: cross-compiling alternatives (was Re: [PATCH 0/1] Embedded Maintainer(s)...)

In reply to Enrico Weigelt
Quoted 11 lines · On Tuesday 17 June 2008 15:46:36 Enrico Weigelt wrote:
Quoted 10 lines · Alexander Neundorf
Quoted 9 lines · On Monday 16 June 2008 17:15:37 Enrico Weigelt wrote:
Quoted 7 lines · Alexander Neundorf

CMake has a cache, where the values of variables are stored, e.g. if an option is enabled or not, or where a library has been found (e.g. JPEG_LIBRARY=/usr/local/lib/libjpeg.so).
The way to influence the behaviour of cmake is to change the value of these variables, this can be done either via a GUI (curses based or with cmake 2.6 also a graphical one), or via the command line:

$ cmake -D<name_of_variable>=<new_value> ...more options
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Are these variables strictly specified or is all left to individual author's decision ?

Authors decision.

Then you've got the same problem as w/ autoconf's config.status:
You have to tweak it for each individual package separately :(

Well, these are all more or less scripting languages, so people can create whichever variables they like, no way to enforce something. Still one can suggest standards which should be followed.

Alex

#180 lore raw
In reply to David Woodhouse
Quoted 19 lines · David Woodhouse
Quoted 18 lines · Andi Kleen
Quoted 6 lines · David Woodhouse

Andrew Morton has been saying recently that we need an 'embedded maintainer', to take responsibility for 'embedded issues' in the core kernel, as well as trying to improve our relationship with those using the Linux kernel for 'embedded' devices -- who have a reputation of not working with us very closely; to their detriment as well as our own.

I hope your job description doesn't include adding more and more CONFIGs though.

I am sure there are lots of low hanging fruit where memory can be saved and it's a good thing someone cares about that, but please don't focus on the code size only. Or if you work on that don't do it using CONFIG or when you really add a new one find some other that is pointless and remove it first.

Quoted 5 lines
Quoted 2 lines

There are simply already far too many of them and they make the kernel harder and harder to change.

I agree. And if we do want to pay attention to pure code size, there are other approaches -- like --gc-sections

I have some patches in this area too. Were submitted to Sam but he was too busy it seems.
--
vda

#195 lore raw
In reply to Andi Kleen
Quoted 6 lines · Andi Kleen
Quoted 2 lines

To a large extent, I agree. I certainly don't want to focus solely on code size; there's a lot more to embedded Linux than that. But it _is_

Not only code size, far more important is dynamic memory consumption. [admittedly we right now lack a good instrumentation framework for this]

Quoted 7 lines
Quoted 3 lines

There are some cases where we really _do_ want to have CONFIG options, but I agree that we should keep them to a minimum. And when we _do_ have CONFIG options, they don't have to litter the actual code with ifdefs.

The problem I see is more that really nobody can even compile not alone test all these combinations anymore. Hidding the problem in inlines does not solve that. And no randconfig is not the solution either.

Because we allowed kernel to be developed without the requirement that random config should be buildable for release kernels.

Had it been a requirement, keeping it in shape wouldn't be too difficult.

Sure enough, _now_ fixing kernel to pass such a test on i386 would take several weeks of work at least. But it is doable.

I would even volunteer to do it if there are some reasonable chances resulting patches would be viewed as worthwhile for inclusion. I am somewhat tired of killing weeks of my time only to find that my work is deemed "not important enough for inclusion". --
vda

#196 lore raw
Quoted 18 lines · Denys Vlasenko
Quoted 6 lines · Andi Kleen
Quoted 2 lines

To a large extent, I agree. I certainly don't want to focus solely on code size; there's a lot more to embedded Linux than that. But it _is_

Not only code size, far more important is dynamic memory consumption. [admittedly we right now lack a good instrumentation framework for this]

Quoted 7 lines
Quoted 3 lines

There are some cases where we really _do_ want to have CONFIG options, but I agree that we should keep them to a minimum. And when we _do_ have CONFIG options, they don't have to litter the actual code with ifdefs.

The problem I see is more that really nobody can even compile not alone test all these combinations anymore. Hidding the problem in inlines does not solve that. And no randconfig is not the solution either.

Because we allowed kernel to be developed without the requirement that random config should be buildable for release kernels.

Quoted 6 lines

Had it been a requirement, keeping it in shape wouldn't be too difficult.

Sure enough, _now_ fixing kernel to pass such a test on i386 would take several weeks of work at least. But it is doable.
...

On i386 it might even already work today.

But guess how much time it costs to get at least all defconfigs compiling on the other 22 architectures.

Even getting allmodconfig/allyesconfig compiling isn't trivial for all architectures, and random configurations are _far_ from compiling.

And we are not talking about something to be done once, as soon as you leave x86 there are tons of regular breakages.

Plus the fact that you often get into situations where more options mean complex and fragile stuff. Read the Kconfig files under drivers/media/ and check in git all commits to them since 2.6.25 alone, and you'll understand why "add an option for every bit" can result in very high ongoing maintainance work required.

Not everything that is technically possible is also maintainable, and maintainability is a very important point in a project with several million lines changing each year.

Quoted 1 line

vda

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#197 lore raw
Quoted 9 lines · Adrian Bunk

Plus the fact that you often get into situations where more options mean complex and fragile stuff. Read the Kconfig files under drivers/media/ and check in git all commits to them since 2.6.25 alone, and you'll understand why "add an option for every bit" can result in very high ongoing maintainance work required.

Not everything that is technically possible is also maintainable, and maintainability is a very important point in a project with several million lines changing each year.

Well, I am not (and was not) disputing this. I agree with it. CONFIGs should not be multiplying like rabbits.
--
vda

#181 lore raw
In reply to Denys Vlasenko
Quoted 20 lines · Denys Vlasenko
Quoted 19 lines · David Woodhouse
Quoted 18 lines · Andi Kleen
Quoted 6 lines · David Woodhouse

Andrew Morton has been saying recently that we need an 'embedded maintainer', to take responsibility for 'embedded issues' in the core kernel, as well as trying to improve our relationship with those using the Linux kernel for 'embedded' devices -- who have a reputation of not working with us very closely; to their detriment as well as our own.

I hope your job description doesn't include adding more and more CONFIGs though.

I am sure there are lots of low hanging fruit where memory can be saved and it's a good thing someone cares about that, but please don't focus on the code size only. Or if you work on that don't do it using CONFIG or when you really add a new one find some other that is pointless and remove it first.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

There are simply already far too many of them and they make the kernel harder and harder to change.

I agree. And if we do want to pay attention to pure code size, there are other approaches -- like --gc-sections

I have some patches in this area too. Were submitted to Sam but he was too busy it seems.

They were not trivial to apply and so went down on the TODO list. We could try to push the generic and x86 specific .lds stuff via the arch maintainers?

Sam

#198 lore raw
In reply to Adrian Bunk
Quoted 25 lines · Adrian Bunk
Quoted 6 lines · Denys Vlasenko

Had it been a requirement, keeping it in shape wouldn't be too difficult.

Sure enough, _now_ fixing kernel to pass such a test on i386 would take several weeks of work at least. But it is doable.
...

On i386 it might even already work today.

But guess how much time it costs to get at least all defconfigs compiling on the other 22 architectures.

Even getting allmodconfig/allyesconfig compiling isn't trivial for all architectures, and random configurations are _far_ from compiling.

And we are not talking about something to be done once, as soon as you leave x86 there are tons of regular breakages.

Plus the fact that you often get into situations where more options mean complex and fragile stuff. Read the Kconfig files under drivers/media/ and check in git all commits to them since 2.6.25 alone, and you'll understand why "add an option for every bit" can result in very high ongoing maintainance work required.

Quoted 3 lines

Not everything that is technically possible is also maintainable, and maintainability is a very important point in a project with several million lines changing each year.

OK sure. Nobody's going to disagree with that. I would, however, disagree with a characterization of Linux-tiny as "adding an option for every bit". Linux-tiny has been around about 5 years now, and if you added the whole thing right now you'd add about 30 config options.

If you're worried about this multiplying out of control, let me just say that having to curtail the rate of patch submission by embedded developers has not been our biggest problem. :-)
-- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum Senior Staff Engineer, Sony Corporation of America
=============================

#182 lore raw
In reply to Sam Ravnborg
Quoted 7 lines · Sam Ravnborg
Quoted 5 lines
Quoted 2 lines

I agree. And if we do want to pay attention to pure code size, there are other approaches -- like --gc-sections

I have some patches in this area too. Were submitted to Sam but he was too busy it seems.

They were not trivial to apply and so went down on the TODO list.

I realize that they were not trivial to review, but that was unavoidable. They were even more not trivial to create.

Quoted 2 lines

We could try to push the generic and x86 specific .lds stuff via the arch maintainers?

IIRC I splitted the entire GC collection patch in a way that first patches were doing exactly this easier first part and I hoped that at least these first patches
will be taken. They were big, but somewhat trivial, from "it's obviously safe" department.

Had they been applied, now making --gc-sections to work would be easier.
--
vda

#183 lore raw
Quoted 12 lines · Denys Vlasenko
Quoted 7 lines · Sam Ravnborg
Quoted 5 lines
Quoted 2 lines

I agree. And if we do want to pay attention to pure code size, there are other approaches -- like --gc-sections

I have some patches in this area too. Were submitted to Sam but he was too busy it seems.

They were not trivial to apply and so went down on the TODO list.

I realize that they were not trivial to review, but that was unavoidable. They were even more not trivial to create.

Quoted 8 lines
Quoted 2 lines

We could try to push the generic and x86 specific .lds stuff via the arch maintainers?

IIRC I splitted the entire GC collection patch in a way that first patches were doing exactly this easier first part and I hoped that at least these first patches
will be taken. They were big, but somewhat trivial, from "it's obviously safe" department.

I do not recall anything wrong with the patch-set.

Quoted 3 lines

Had they been applied, now making --gc-sections to work would be easier.

Agreed. I should have asked you to push this via arch maintainers back then.

Sam

#199 lore raw
In reply to Adrian Bunk
Quoted 22 lines · Adrian Bunk
Quoted 14 lines · Denys Vlasenko
Quoted 10 lines · Andi Kleen
Quoted 2 lines

To a large extent, I agree. I certainly don't want to focus solely on code size; there's a lot more to embedded Linux than that. But it _is_

Not only code size, far more important is dynamic memory consumption. [admittedly we right now lack a good instrumentation framework for this]

Quoted 3 lines

There are some cases where we really _do_ want to have CONFIG options, but I agree that we should keep them to a minimum. And when we _do_ have CONFIG options, they don't have to litter the actual code with ifdefs.

The problem I see is more that really nobody can even compile not alone test all these combinations anymore. Hidding the problem in inlines does not solve that. And no randconfig is not the solution either.

Because we allowed kernel to be developed without the requirement that random config should be buildable for release kernels.

Quoted 6 lines

Had it been a requirement, keeping it in shape wouldn't be too difficult.

Sure enough, _now_ fixing kernel to pass such a test on i386 would take several weeks of work at least. But it is doable.
...

Quoted 8 lines

On i386 it might even already work today.

But guess how much time it costs to get at least all defconfigs compiling on the other 22 architectures.

Even getting allmodconfig/allyesconfig compiling isn't trivial for all architectures, and random configurations are _far_ from compiling.

And we are not talking about something to be done once, as soon as you leave x86 there are tons of regular breakages.

Could automated builds and build error reporting be used to help resolve these problems?

The good people at Simtec have an automated build report available as an e-mail digest. I use it to watch for architecture build breakages in subsystems or drivers that I use or touch. It covers defconfigs of ARM and MIPS architectures and reports compile errors/warnings, module size, kernel size etc. If this approach were extended/distributed to cover more architectures and random config builds, developers could with little effort spot problems and fix them. Hell, it might also encourage new developers to get involved and contribute.

Here's a link to a recent report for ARM, fyi:-

http://lists.simtec.co.uk/pipermail/kautobuild/2008-June/001299.html

Quoted 10 lines

Plus the fact that you often get into situations where more options
mean complex and fragile stuff. Read the Kconfig files under drivers/media/ and check in git all commits to them since 2.6.25 alone, and you'll understand why "add an option for every bit" can result in very high ongoing maintainance work required.

Not everything that is technically possible is also maintainable, and maintainability is a very important point in a project with several million lines changing each year.

Quoted 1 line

vda

cu
Adrian

Signature · 4 lines
James Chapman
Katalix Systems Ltd
http://www.katalix.com
Catalysts for your Embedded Linux software development
#200 lore raw
Quoted 39 lines · James Chapman
Quoted 26 lines · Adrian Bunk
Quoted 16 lines · Denys Vlasenko
Quoted 5 lines · Andi Kleen
Quoted 2 lines

To a large extent, I agree. I certainly don't want to focus solely on code size; there's a lot more to embedded Linux than that. But it _is_

Not only code size, far more important is dynamic memory consumption. [admittedly we right now lack a good instrumentation framework for this]

Quoted 7 lines
Quoted 3 lines

There are some cases where we really _do_ want to have CONFIG options, but I agree that we should keep them to a minimum. And when we _do_ have CONFIG options, they don't have to litter the actual code with ifdefs.

The problem I see is more that really nobody can even compile not alone test all these combinations anymore. Hidding the problem in inlines
does not solve that. And no randconfig is not the solution either.

Because we allowed kernel to be developed without the requirement that random config should be buildable for release kernels.

Quoted 6 lines

Had it been a requirement, keeping it in shape wouldn't be too difficult.

Sure enough, _now_ fixing kernel to pass such a test on i386 would take several weeks of work at least. But it is doable.
...

On i386 it might even already work today.

Quoted 8 lines

But guess how much time it costs to get at least all defconfigs compiling on the other 22 architectures.

Even getting allmodconfig/allyesconfig compiling isn't trivial for all architectures, and random configurations are _far_ from compiling.

And we are not talking about something to be done once, as soon as you leave x86 there are tons of regular breakages.

Could automated builds and build error reporting be used to help resolve these problems?

Quoted 6 lines

The good people at Simtec have an automated build report available as an e-mail digest. I use it to watch for architecture build breakages in subsystems or drivers that I use or touch. It covers defconfigs of ARM and MIPS architectures and reports compile errors/warnings, module size, kernel size etc. If this approach were extended/distributed to cover more architectures

Jan Dittmer has a great page showing the build status and kernel size of the defconfigs of all architectures that is running since 2004 or 2005:
http://l4x.org/k/

Quoted 3 lines

and random config builds, developers could with
little effort spot problems and fix them. Hell, it might also encourage new developers to get involved and contribute.

Perhaps in an ideal world...

In reality, I'd claim I'm one out of only two people who regularly fix architecture-specific build problems for all architectures.

Quoted 1 line

James Chapman

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed