HNHacker News
TopNewBestAskShowJobs

mansr

619 karma · joined September 17, 2009

submissionscomments
mansr··on Volatiles Are Miscompiled, and What to Do about It [pdf]
A common scenario is filling a data buffer in normal memory (cached or non-cached doesn't matter on ARM) before initiating a DMA operation by writing to a device register. In this situation, a barrier is required to prevent any of the normal writes being reordered around the DMA initiation which would then see stale data in the buffer.

Discussions about barriers (or volatile) are only meaningful in the context of related accesses, so explicitly mentioning this isn't really necessary.

mansr··on Volatiles Are Miscompiled, and What to Do about It [pdf]
Modern high-performance ARM cores such as the Cortex-A15 do plenty of reordering. Even when using strongly ordered memory mappings, you still need barriers to prevent reordering between normal and strongly ordered accesses. No amount of volatile will help with this.
mansr··on Volatiles Are Miscompiled, and What to Do about It [pdf]
That's when you start finding bugs in the disassembler.
mansr··on Stop the autoconf insanity – Why we need a new build system (2003)
1. Are you seriously complaining over make itself not creating the zip file, duplicating the functionality of the 'zip' tool?

2-3. This command does what you want: zip -R -FS foo.zip '*.c'

4. In practice timestamps work just fine unless you deliberately sabotage them. To use content hashes, the hashes of the input files when creating a target would need to be stored somewhere for future reference. This storage place could just as easily be corrupted. Make is a build tool, not a VCS. Treat it as such.

Yes, some things are specific to GNU make, but it is the de facto standard, something waf can only dream of. If you're going to complain about something being non-standard, your suggested alternative should be more of a standard, not less.

If you want bz2, why did you ask for zip?

mansr··on Stop the autoconf insanity – Why we need a new build system (2003)
Actually creating the archive is not make's job, which is what bjourne seems to be complaining about. Collecting a list of files and passing to a command is what make does. It doesn't care if that command is a compiler or an archiver, nor should it.

Regarding your chained dependencies, how do you expect _any_ tool to figure this out without either being told or examining the inputs (which implies knowledge of their formats)? Relegating this to an external tool seems perfectly appropriate to me.

mansr··on Stop the autoconf insanity – Why we need a new build system (2003)
Let's assume for sake of argument that you are right (although as ori_b shows, you are not). Why do you expect this functionality from _make_ specifically? Nobody ever claimed it can do everything. In fact, it's a good thing it doesn't even try to do tasks for which other, purpose-built tools exist. Creating compressed archives is a very different task from managing dependency graphs. Make was built for, and excels at, the latter. For the former there are better choices (and they can be called from make if need be).
mansr··on Stop the autoconf insanity – Why we need a new build system (2003)
You're right, I have no experience with waf, and I'm not dismissing it. I'm saying much, if not most, criticism of make is unfounded and misplaced.

Want a zip file? Use a command like "git archive -o foo.zip HEAD".

Why do you insist on having a single tool do all your tasks? A good craftsman has an arsenal of tools and picks the right one for each job.

mansr··on Stop the autoconf insanity – Why we need a new build system (2003)
It wouldn't take much at all to have the AC_ERROR macro append the message to a global variable, set a global error flag, and continue. At the end of the script, if the error flag is set, the aggregated error messages would be printed. The variable names would only need to be coordinated between AC_ERROR and one other macro called at the end.
mansr··on Stop the autoconf insanity – Why we need a new build system (2003)
The official manual is mostly easy to understand. There are various 3rd-party books available, but I haven't read any of them.
mansr··on Stop the autoconf insanity – Why we need a new build system (2003)
Your comment betrays your ignorance.

Firstly, you call it "make script," suggesting that you view makefiles as a typical (procedural) script that is executed from top to bottom. I base this on my experiences working closely with others who also used the term "make script," all of whom suffered from this misconception.

Secondly, GNU make does have function calls. Look up the $(call ...) construct. When the built-in functionality is insufficient (and of course such cases come up), it is trivial to call an external script, written in your language of choice, using either the $(shell ...) syntax or as part of a target recipe.

As for the "Missing separator. Stop." it is not fair to dismiss an entire tool because of one slightly obscure error message.

I also find it ironic that you complain about tabs vs spaces, then go on to suggest using python, which also has invisible whitespace as part of its syntax.

mansr··on Stop the autoconf insanity – Why we need a new build system (2003)
The power of Emacs is that the configuration file is more than just that. It is code that becomes part of the editor and can replace pretty much any part thereof if the user so desires.
mansr··on Stop the autoconf insanity – Why we need a new build system (2003)
Replacing make with python is a huge step back. The makefile language is simple yet extremely powerful for describing a dependency tree such as that for building an executable from sources. Its perhaps strongest point is that it completely agnostic to what the different steps actually do rather than consist of a predefined set of canned rules/tasks with, if you're lucky, a convoluted way of adding your own using e.g. python (or worse, java). This means that as long as a shell command can turn a set of inputs into an output, describing it takes (usually) just two lines of makefile, one naming the target and prerequisites, one providing the command to perform the transformation. If a particular rule is too complicated for a few shell commands, invoking a separate script (or even a just-built executable) is trivial. Every other system I've looked at needed a comparatively enormous amount of code for adding even the slightest tweak to the built-in rules.

GNU make is actually two different languages coexisting in the same file (the makefile), a declarative language for describing the targets and their dependencies as well as a functional language for the variables/macros. Once you realise this, a whole new world of possibilities opens up. If more people took the time to actually understand proper use of makefiles, perhaps we'd see fewer poorly reinvented wheels.

mansr··on Stop the autoconf insanity – Why we need a new build system (2003)
I find neither sh nor make particularly painful. Python, however, I cannot stand the sight of.
mansr··on Stop the autoconf insanity – Why we need a new build system (2003)
Text editors are a solved problem since Emacs was written.
mansr··on Stop the autoconf insanity – Why we need a new build system (2003)
Most of the so-called modern build tools avoid make entirely, so its syntax cannot be to blame for their miserable quality.
mansr··on Installing VLC Media Player voids your speaker warranty
When the Samsung ARM Chromebook came out, people quickly found that careless tinkering with alsamixer caused the speakers to overheat and melt the case as a result of being driven with a high DC current. A driver update blocked the control causing the damaging signal routing.
mansr··on What should we expect from a modern init system?
OpenRC is exactly that.
mansr··on US banks threaten to charge for deposits
Setting user agent to Google bot lets you through.
mansr··on How Apple’s ‘Blacklist’ Manipulates the Press
Public perception is influenced by the first reviews published on a new product. If you give a few known friendly writers early access, there will be a few days of nothing but positive reporting. Mainstream media will then pick this up as "overwhelmingly positive" response to the new thing.

Of course Apple has the right to behave like this. Nevertheless, it's good for consumers to know that the early reviews are carefully shaped, so if you want a balanced picture, you need to wait until after the public release.

mansr··on Deep C and C++ (2011)
Static initialisers are a horrible example of "deep" knowledge. Not knowing how they work reveals not only ignorance of syntax but a fundamental lack of understanding of the entire programming and execution environment. Failure to understand your environment inevitably leads to confusion and bad decisions.
mansr··on Deep C and C++ (2011)
The C99 standard explicitly says type punning through a union is allowed. This is clarified in TC3 (2007) by the addition of this note in section 6.5.2.3:

  If the member used to access the contents of a union object
  is not the same as the member last used to store a value in
  the object, the appropriate part of the object representation
  of the value is reinterpreted as an object representation in
  the new type as described in 6.2.6 (a process sometimes called
  "type punning"). This might be a trap representation.
mansr··on Deep C and C++ (2011)
What the language standard does not specify (and is very explicit about not doing) is padding between struct members, if any. However, the ABI spec for the compilation target details exactly how a struct must be laid out. If this were not the case, libraries could not work.
mansr··on Don't Fly During Ramadan
About 6 months ago, I had the explosives detector at SFO flag me as suspect after a random pat-down. What followed was a second, slightly more thorough, pat-down and a very thorough search of my carry-on. It all took about 15 minutes, and the TSA staff were nothing but friendly throughout the procedure.

Whenever you fly, keep two things in mind: 1) the TSA staff are mostly just doing their job, and 2) not all of them are assholes.

mansr··on Xerox responds to the recent character substitution issue
JPEG will not do that, but MPEG at high compression levels might.
mansr··on Expert Says NSA Have Backdoors Built Into Intel And AMD Processors
This encoding would have to be maintained by every router until it reaches an intercept point.
mansr··on Expert Says NSA Have Backdoors Built Into Intel And AMD Processors
Supposing there is some kind of "backdoor" in my CPU, how do they access it? Is there hidden code in my router hardware too allowing packets to/from the NSA through while hiding from any monitoring?
mansr··on Compilers in OpenBSD
There are two fundamental problems with CompCert: 1) there is no formal, machine-readable specification of the C language, and 2) there is no formal, machine-readable specification of the target architectures. CompCert may be formally verified, but it's not necessarily a C compiler (even ignoring that it implements only a subset of C), nor does it necessarily compile for the advertised architecture.
mansr··on Compilers in OpenBSD
In my experience gcc has fewer bugs than icc or xlc.
mansr··on Compilers in OpenBSD
> LLVM [...] don't give a shit about getting llvm/clang to build linux.git.

The LLVMLinux project is making good progress towards this goal. http://llvm.linuxfoundation.org/

mansr··on Scientific Breakthrough Lets SnappyCam App Take 20 Full-Res Photos Per Second
Motion estimation/prediction is used video coding because it minimises the compressed size. However, it is incredibly expensive to perform the motion search. A typical video encoder spends well over half its CPU time in this stage. After motion estimation, the residual image is encoded in the usual way, so speed-wise the motion search is a complete loss.
← PreviousPage 3 of 9Next →