9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] impressive
@ 2006-04-26  0:26 erik quanstrom
  2006-04-26  0:48 ` geoff
                   ` (2 more replies)
  0 siblings, 3 replies; 69+ messages in thread
From: erik quanstrom @ 2006-04-26  0:26 UTC (permalink / raw)
  To: 9fans

gcc 4 can be c99 compliant.

	gcc '--std=c99' $*

but that doesn't mean that they removed the extensions.

linux is dependent on inline assembly, for example.  (i'm not sure why they
think it necessiary.)  so a number of their extensions won't go away.  in fact,
other compilers, like tcc, feel compelled to replicate gnu extensions.

- erik

On Tue Apr 25 15:02:51 CDT 2006, cross@math.psu.edu wrote:
> On Tue, Apr 25, 2006 at 01:02:30PM +1000, Andy Newman wrote:
> > I like this quote from the glibc FAQ...
> >
> >     1.2. What compiler do I need to build GNU libc?
> >
> >     ...  A lot of extensions of GNU CC are used to increase portability ...
>
> I remember a year or two picking up a Linux rag at the train station on the
> way back from somewhere.  They were talking about gcc 4 or something in it
> and saying how they were hoping to do away with a lot of GNU extensions by
> stricter adherence to the language standards in the compiler itself; I guess
> that work got buried.  Then again, this was a cursory read on the Subway,
> and I'm slightly dyslexic, so maybe  read it the opposite way it was meant.
>
> 	- Dan C.
>


^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: [9fans] impressive
@ 2006-05-10  0:45 erik quanstrom
  2006-05-10  2:09 ` Lyndon Nerenberg
  0 siblings, 1 reply; 69+ messages in thread
From: erik quanstrom @ 2006-05-10  0:45 UTC (permalink / raw)
  To: 9fans

i think your problems miss the point.  an explicit portability layer
is another name for a virtual os interface.  breaking things
up on a call-by-call basis creates calls^2 virtual os interfacen. 
good luck in testing.

of course the simple virtual interface is usually too simple to express
what the autoconf guys are really after, so they add a level of indirection.

the ironic bit about autoconf is that the vast majority of autoconf garbage
is dedicated to features that don't make any difference.  using the
lowest-common denomitor call would work just as well. (and why
not, you have to code this case anyway.)

it /is/ possible to make stuff portable across many different posixish
systems with very little code.  p9p really does a nice job.  there's some
glue, but that's mostly for the thread library and some networking goo.
most projects don't need to get that friendly with the hardware.

- erik

On Tue May  9 16:57:15 CDT 2006, davide+p9@cs.cmu.edu wrote:
> The "old way" was to create an explicit portability layer,
> with the application running on top of that layer and
> one version of the layer for each platform.  So each
> application would need one expert to maintain the SunOS
> blob, one to maintain the HP-UX blob, etc.
> 
> The autoconf approach (following perl's pioneering
> configuration infrastructure) was based on the observation
> that the 1995 version of the SunOS blob and the 1995
> version of the Irix blob looked somewhat like each other,
> especially in the sense that if you looked at the 1998
> version of each the underlying platforms had added many
> of the same features.  Also, if you looked at the SunOS
> blob for one application and the SunOS blob for another
> application, they would of course share many similarities.
> 
> So the theory was to ignore platforms and start testing
> for *features*, and the hope was that once a *feature*
> had been coded for platforms would add the feature over
> time and all software using autoconf would automatically
> start using the feature.  Great!


^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: [9fans] impressive
@ 2006-05-08 22:02 erik quanstrom
  0 siblings, 0 replies; 69+ messages in thread
From: erik quanstrom @ 2006-05-08 22:02 UTC (permalink / raw)
  To: 9fans

evolution guarantees change.  it doesn't guarantee /good/ change.
in software, i perfer intelligent design the dodo bird.

- erik

On Mon May  8 16:11:22 CDT 2006, knapjack@gmail.com wrote:
> On 5/8/06, LiteStar numnums <litestar@gmail.com> wrote:
> > seems. So for the half
> > our conformity test/configuration, it still wouldn't actually tell me what
> > was really missing, which was
> > fun because it kept passing the thread test sections...
> 
> So, it sounds like autoconf may function as intended but perhaps the
> person who wrote the test needs some help?
> 
> Given that progress is likely to be evolutionary rather than
> revolutionary, what kind of system or environment do you see that has
> potential to wean people from autoconf with as minimal hassle as
> possible?  If I'm engrossed in autoconf hell for whatever reason --
> say I'm the Firefox build maintainer, for instance -- what does the
> path out look like?
> 
> -Jack
> 


^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: [9fans] impressive
@ 2006-04-27  2:13 erik quanstrom
  0 siblings, 0 replies; 69+ messages in thread
From: erik quanstrom @ 2006-04-27  2:13 UTC (permalink / raw)
  To: 9fans

a new accusation leveled against me.  i'll have to add it to the list.

- erik

On Wed Apr 26 21:08:27 CDT 2006, knapjack@gmail.com wrote:
> On 4/26/06, erik quanstrom <quanstro@quanstro.net> wrote:
> > 100 Pure Evil™. ;-)
> 
> Now *that* is a marketing slogan!
> 
> -Jack


^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: [9fans] impressive
@ 2006-04-27  1:35 erik quanstrom
  0 siblings, 0 replies; 69+ messages in thread
From: erik quanstrom @ 2006-04-27  1:35 UTC (permalink / raw)
  To: 9fans

uh, i dunno.  stallman?

http://www.stallman.org/#long-term

- erik

On Wed Apr 26 10:29:39 CDT 2006, rian@MIT.EDU wrote:
>
> God knows where this nut gets his logic. Of course all bad logic is
> contradictory, if people only ever supported "majority" systems Linux
> would never exist. Actually let's scratch anything ever existing.
>
> Rian
>


^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: [9fans] impressive
@ 2006-04-27  1:23 erik quanstrom
  2006-04-27  5:08 ` Micah Stetson
  0 siblings, 1 reply; 69+ messages in thread
From: erik quanstrom @ 2006-04-27  1:23 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 1235 bytes --]

unfortunately, this does makes sense.

while the code for autoconf has ballooned, it's support for non linux
systems has decreased.  i believe the folk who maintain it envision it
as a way to support a vast matrix of packages, each trying to use the
very most bleeding edge features of the others on linux.

this is often gratitous, and feeds on itself.  but there aren't many
services (e.g. 9660fs) in linux -- everything's a .so.

i've attached a dependency graph of mplayer on gentoo.  it's 160 lines.

- erik

On Wed Apr 26 11:40:44 CDT 2006, micah@stetsonnet.org wrote:
> > http://udrepper.livejournal.com/7326.html:
> >     The only OSes supported in the [glibc] tree are Linux and to some
> > extend Hurd.
> >     ...
> >     For my new projects the razor is even sharper. Only Linux is supported...
>
> The part I find funny is that he calls everybody who doesn't like
> autoconf a "winer" (am I a winner, a whiner, or a wiener? there's a
> critical letter missing here) because it makes portability "quite
> easy" and then proceeds to rant about how maintaining portable code is
> too heavy a load for his projects to bear.  So it's too hard, but only
> winners think he's doing it wrong?
>
> Micah

[-- Attachment #2: mplayer.dep --]
[-- Type: text/plain, Size: 8512 bytes --]

media-video/mplayer-1.0.20060415:
`-- media-video/mplayer-1.0.20060415
 `-- media-libs/xvid-1.0.3 [ xvid ]
  `-- dev-lang/nasm-0.98.39-r1 [ x86 ]
   `-- dev-lang/perl-5.8.7-r3 [ !build ]
    `-- sys-devel/libperl-5.8.7
     `-- sys-libs/db-4.2.52_p2-r1 [ berkdb ]
      `-- dev-lang/tcl-8.4.9 [ tcltk ]
       `-- sys-libs/glibc-2.3.5-r3 (virtual/libc)
        `-- sys-devel/gettext-0.14.4 [ nls ]
         `-- sys-devel/patch-2.5.9 [ !bootstrap ]
         `-- sys-apps/shadow-4.0.14-r1 [ !bootstrap userland_GNU ]
          `-- sys-libs/cracklib-2.8.5-r1
          `-- sys-libs/pam-0.78-r3 (virtual/pam) [ pam ]
           `-- sys-libs/pwdb-0.62 [ pwdb ]
           `-- dev-util/pkgconfig-0.20
           `-- sys-devel/autoconf-2.59-r7
            `-- sys-apps/texinfo-4.8-r2
             `-- sys-libs/ncurses-5.4-r6 [ !build ]
              `-- sys-libs/gpm-1.20.1-r4 [ gpm ]
            `-- sys-devel/autoconf-wrapper-3-r1
             `-- sys-devel/autoconf-2.13
              `-- sys-devel/m4-1.4.4
           `-- sys-devel/automake-1.9.6-r1
            `-- sys-devel/automake-wrapper-1-r1
             `-- sys-devel/automake-1.4_p6
              `-- sys-devel/gnuconfig-20060227
             `-- sys-devel/automake-1.5
             `-- sys-devel/automake-1.6.3
             `-- sys-devel/automake-1.7.9-r1
             `-- sys-devel/automake-1.8.5-r3
           `-- sys-devel/flex-2.5.33-r1
          `-- sys-apps/portage-2.0.54 [ !pam !sys-apps/pam-login ]
           `-- sys-apps/sed-4.1.4-r1 [ !build ]
            `-- virtual/libintl-0 (virtual/libintl) [ nls ]
           `-- dev-python/python-fchksum-1.7.1 [ !build ]
            `-- sys-libs/zlib-1.2.3
           `-- dev-lang/python-2.4.2 [ !build ]
            `-- dev-lang/tk-8.4.9 [ !dev-python/cjkcodecs X tcltk ]
             `-- x11-base/xorg-x11-6.8.2-r6 (virtual/x11)
              `-- dev-libs/expat-1.95.8
              `-- media-libs/freetype-2.1.9-r1
              `-- media-libs/fontconfig-2.2.3
              `-- x11-base/opengl-update-3.0.0 [ opengl ]
               `-- app-admin/eselect-opengl-1.0.3
                `-- app-admin/eselect-1.0
                `-- app-arch/bzip2-1.0.3-r6
              `-- media-libs/libpng-1.2.8-r1
              `-- sys-apps/groff-1.19.1-r2
              `-- sys-apps/util-linux-2.12r-r3 [ userland_GNU ]
               `-- sys-fs/e2fsprogs-1.38-r1
                `-- sys-libs/com_err-1.38
                `-- sys-libs/ss-1.38
               `-- app-crypt/hashalot-0.3-r2 [ crypt ]
               `-- sys-kernel/linux-headers-2.6.11-r2 (virtual/os-headers)
            `-- sys-libs/readline-5.1_p4 [ !dev-python/cjkcodecs ncurses readline ]
             `-- app-shells/bash-3.1_p16
            `-- sys-libs/gdbm-1.8.3-r2 [ !dev-python/cjkcodecs gdbm ]
            `-- dev-libs/openssl-0.9.7i [ !dev-python/cjkcodecs ssl ]
             `-- sys-apps/diffutils-2.8.7-r1
             `-- sys-devel/bc-1.06-r6 [ test ]
           `-- sys-apps/debianutils-2.15 [ !build userland_GNU ]
           `-- app-misc/pax-utils-0.1.10 [ !userland_Darwin ]
            `-- sys-libs/libcap-1.10-r5 [ caps ]
             `-- dev-lang/swig-1.3.21 [ !nocxx python ]
              `-- dev-java/blackdown-jdk-1.4.2.03 (virtual/jdk) [ java ]
               `-- dev-java/java-config-1.2.11-r1
               `-- media-libs/alsa-lib-1.0.10 [ alsa ]
                `-- sys-kernel/gentoo-sources-2.6.15-r1 (virtual/alsa)
                 `-- sys-devel/make-3.80-r4 [ !build ]
                 `-- sys-fs/udev-079-r1 (virtual/dev-manager)
                  `-- sys-apps/hotplug-base-20040401
                  `-- sys-apps/baselayout-1.11.14-r6
                   `-- sys-apps/sysvinit-2.86-r3
                   `-- sys-apps/coreutils-5.94-r1 [ !build !bootstrap ]
                    `-- sys-apps/help2man-1.33.1
                     `-- dev-perl/Locale-gettext-1.05 [ nls ]
                      `-- perl-core/Test-Simple-0.62
                 `-- sys-devel/binutils-2.16.1 [ !build ]
                  `-- sys-devel/binutils-config-1.8-r7
                 `-- app-text/docbook-sgml-utils-0.6.14 [ doc ]
                  `-- app-text/docbook-dsssl-stylesheets-1.79
                   `-- app-text/sgml-common-0.6.3-r4
                  `-- app-text/openjade-1.3.2-r1
                   `-- app-text/opensp-1.5.1
                  `-- dev-perl/SGMLSpm-1.03-r5
                  `-- app-text/docbook-xml-simple-dtd-4.1.2.4-r2
                   `-- app-arch/unzip-5.52
                  `-- app-text/docbook-xml-simple-dtd-1.0-r1
                   `-- dev-libs/libxml2-2.6.23
                  `-- app-text/docbook-xml-dtd-4.4-r1
                   `-- app-text/docbook-xsl-stylesheets-1.68.1-r1
                    `-- app-text/build-docbook-catalog-1.2
                  `-- app-text/docbook-sgml-dtd-3.0-r3
                  `-- app-text/docbook-sgml-dtd-3.1-r3
                  `-- app-text/docbook-sgml-dtd-4.0-r3
                  `-- app-text/docbook-sgml-dtd-4.1-r3
                  `-- app-text/jadetex-3.13-r1 [ tetex ]
                   `-- app-text/tetex-2.0.2-r8 (virtual/tetex)
                    `-- net-libs/libwww-5.4.0-r4 [ !app-text/tetex ]
                    `-- dev-util/dialog-1.0.20050206 [ !app-text/tetex !app-text/dvipdfm !dev-tex/eurosym ]
                  `-- sys-apps/which-2.16
                  `-- www-client/links-2.1_pre20 (virtual/textbrowser)
                   `-- media-libs/jpeg-6b-r5 [ jpeg ]
                    `-- sys-devel/libtool-1.5.22
                   `-- media-libs/tiff-3.7.3 [ tiff ]
                   `-- media-libs/svgalib-1.9.21-r1 [ svga ]
                    `-- sys-apps/module-init-tools-3.2.1 (virtual/modutils)
                   `-- media-libs/libsdl-1.2.8-r1 [ sdl ]
                    `-- media-libs/audiofile-0.2.6-r1 [ !noaudio ]
                    `-- media-sound/esound-0.2.36-r1 [ esd ]
                     `-- sys-apps/tcp-wrappers-7.6-r8 [ tcpd ]
                    `-- kde-base/arts-3.4.3 [ arts ]
                     `-- x11-libs/qt-3.3.4-r8
                      `-- media-libs/libmng-1.0.8-r1
                       `-- media-libs/lcms-1.14-r1
                      `-- net-print/cups-1.1.23-r7 [ cups ]
                     `-- dev-libs/glib-2.8.6
                      `-- dev-util/gtk-doc-1.4-r1 [ doc ]
                       `-- app-text/docbook-xml-dtd-4.1.2-r5
                       `-- dev-libs/libxslt-1.1.15
                        `-- dev-libs/libgcrypt-1.2.2-r1 [ crypt ]
                         `-- dev-libs/libgpg-error-1.0-r1
                       `-- app-editors/emacs-21.4-r3 (virtual/emacs) [ emacs ]
                        `-- media-libs/giflib-4.1.4
                        `-- x11-libs/Xaw3d-1.5-r1 [ !arm Xaw3d ]
                        `-- x11-libs/openmotif-2.2.3-r9 [ !arm motif !lesstif ]
                     `-- media-libs/libvorbis-1.1.0 [ vorbis ]
                      `-- media-libs/libogg-1.1.2
                     `-- media-libs/libmad-0.15.1b [ mp3 ]
                     `-- kde-base/kde-env-3-r4
                    `-- media-libs/libcaca-0.9-r1 [ libcaca ]
                     `-- media-libs/imlib2-1.2.1.009 [ imlib ]
                   `-- sys-devel/gcc-3.4.5-r1
                    `-- sys-devel/gcc-config-1.3.13-r1
                    `-- x11-libs/gtk+-2.8.12 [ !build gcj ]
                    `-- media-libs/libart_lgpl-2.3.17 [ !build ]
                `-- media-sound/alsa-headers-1.0.10
           `-- sys-apps/sandbox-1.2.12 [ !userland_Darwin ]
        `-- sys-libs/timezone-data-2006a
      `-- dev-java/blackdown-jre-1.4.2.03 (virtual/jre) [ java ]
   `-- app-text/ghostscript-esp-7.07.1-r8 (virtual/ghostscript) [ doc ]
    `-- media-fonts/gnu-gs-fonts-std-8.11
 `-- media-libs/win32codecs-20050216 [ win32codecs ]
 `-- media-video/realplayer-10.0.7 [ x86 real ]
  `-- x11-libs/pango-1.10.3 [ !amd64 ]
  `-- app-arch/rpm2targz-9.0-r3
   `-- app-arch/cpio-2.6-r5
   `-- sys-apps/file-4.13
 `-- media-sound/cdparanoia-3.9.8-r2 [ cdparanoia ]
 `-- media-libs/libdts-0.0.2-r3 [ dts ]
 `-- media-libs/libdvdread-0.9.4-r1 [ dvd dvdread ]
  `-- media-libs/libdvdcss-1.2.9
 `-- media-sound/lame-3.96.1 [ encode ]
  `-- x11-libs/gtk+-1.2.10-r11 [ gtk ]
   `-- dev-libs/glib-1.2.10-r5
   `-- dev-util/intltool-0.34.1 [ nls ]
    `-- dev-perl/XML-Parser-2.34
 `-- media-libs/libdv-0.102 [ encode dv ]
  `-- dev-libs/popt-1.7-r1

^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: [9fans] impressive
@ 2006-04-27  1:10 erik quanstrom
  2006-04-27  2:06 ` Jack Johnson
  0 siblings, 1 reply; 69+ messages in thread
From: erik quanstrom @ 2006-04-27  1:10 UTC (permalink / raw)
  To: 9fans

On Wed Apr 26 17:58:38 CDT 2006, rvs@sun.com wrote:
> P.S. I've kind of come to terms with the fact that working for
> Sun and porting Sun's compilers to Linux makes me a "violent minority"
> but I'm not sure whether it also makes me "pure evil" ;-)

100 Pure Evil™. ;-)

i'm sorry.  i just couldn't help it.

- erik


^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: [9fans] impressive
@ 2006-04-26  3:24 jmk
  0 siblings, 0 replies; 69+ messages in thread
From: jmk @ 2006-04-26  3:24 UTC (permalink / raw)
  To: 9fans

Although I have found this thread mostly trivial, today was
great. I woke up to be prompted to read the glibc FAQ, which
put a smile on my face for a good while, and now, as I prepare
to close out another otherwise depressing day, the rant about
the 'Dicatatship of the Minorities' has done it again.

Thank you. Seriously.

--jim


^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: [9fans] impressive
@ 2006-04-26  2:38 erik quanstrom
  0 siblings, 0 replies; 69+ messages in thread
From: erik quanstrom @ 2006-04-26  2:38 UTC (permalink / raw)
  To: 9fans

it's ironic how this guy can twist the meanings of things.  he says

	he fundamental problem is that configuration options are bad.
	Be it at runtime or at compile. Ideally there is one configuration
	which works everywhere. Every new configuration increases complexity.
	Not linearly but instead exponentially. [i'll take that to be figurative]
	Each option might influence every other option.  This is a disaster not only for users,
	but also the developers. It means exponential growth of testing. [...]


but we've all seen the code.  this is, after all, the dude that got 18 system calls inserted into
linux to support seperate threads calling chdir() and open('realative-path") independent .
good grief.  this is what arlo guthrie would call "off the edge of an edge case".

oddly i would agree but i don't know what he means by "runtime configuration".
some people might call that input.  programs, by definition, need input.

- erik


^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: [9fans] impressive
@ 2006-04-26  0:55 erik quanstrom
  2006-04-26  1:07 ` Roman Shaposhnick
  0 siblings, 1 reply; 69+ messages in thread
From: erik quanstrom @ 2006-04-26  0:55 UTC (permalink / raw)
  To: 9fans

last i ran gcc on sun machines (or aix for that matter), glibc was
not required.  admittedly this was four years ago.  have things changed?

- erik

On Tue Apr 25 19:54:59 CDT 2006, rvs@sun.com wrote:
> On Tue, Apr 25, 2006 at 05:48:00PM -0700, geoff@collyer.net wrote:
> > >From memory and a quick scan of gcc(1) since I don't have time to read
> > the entire manual ``page'' now, `gcc -ansi -pedantic' should compile
> > exactly 1990 ISO C and `gcc --std=c99 -pedantic' should compile
> > exactly 1999 ISO C. Using -pedantic-errors instead of -pedantic will
> > produce fatal errors rather than warnings for using extensions.
>
>   gcc *can not* claim full ISO C99 compatibility for the variety of reasons,
>   but the biggest one being -- glibc is not c99 complaint.
>
> Thanks,
> Roman.


^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: [9fans] impressive
@ 2006-04-25 10:20 erik quanstrom
  0 siblings, 0 replies; 69+ messages in thread
From: erik quanstrom @ 2006-04-25 10:20 UTC (permalink / raw)
  To: 9fans

i have not had a chance to look at dietlibc printf functions. the gnu
version is extra jumbo, and the code is very difficult to read.  but
printf is a pretty big set of functions, regardless.

it's curious that __lltostr is a different functino tha __ltostr.

as rob loves to point out, for small values of n, simple algorithms are
best.  n is usually small.  so i think it's generally a incorrect to
contrast small and fast.

- erik

On Mon Apr 24 21:50:10 CDT 2006, dfawcus@cisco.com wrote:
> On Mon, Apr 24, 2006 at 09:30:37PM -0500, erik quanstrom wrote:
> > On Mon Apr 24 21:16:57 CDT 2006, dfawcus@cisco.com wrote:
> > > glibc is bloated,  printf and strtoul are also quite large.  [..,]
> >
> > noooo.... you're kidding, right?
>
> What I meant is that relative to some other (commonly used) routines within
> dietlibc,  printf and stroul are large in object size terms.  I should have
> written the above as two sentances.
>
> The biggest things seem to be printf support, perror support,  and strtoul.
>
> __v_printf          |080484b8|   T  |              FUNC|00000773|     |.text
> __dtostr            |08048cc7|   T  |              FUNC|000003ae|     |.text
> sys_errlist         |08049650|   R  |            OBJECT|000001f8|     |.rodata
> __umoddi3           |08049400|   T  |              FUNC|000001e5|     |.text
> __udivdi3           |080492c0|   T  |              FUNC|0000013e|     |.text
> strtoul             |080482f0|   T  |              FUNC|0000010e|     |.text
> __lltostr           |080490ec|   T  |              FUNC|000000db|     |.text
> __ltostr            |080491c8|   T  |              FUNC|00000099|     |.text
> strtol              |08048268|   T  |              FUNC|00000086|     |.text
> perror              |080481ec|   T  |              FUNC|0000007a|     |.text
>
> compare to main:
>
> main                |080480bc|   T  |              FUNC|000000d6|     |.text
>
> The dietlibc versions of the algorithms have generally been written to be
> small,  rather than fast.
>
> DF


^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: [9fans] impressive
@ 2006-04-25  2:30 erik quanstrom
  2006-04-25  2:48 ` Derek Fawcus
  0 siblings, 1 reply; 69+ messages in thread
From: erik quanstrom @ 2006-04-25  2:30 UTC (permalink / raw)
  To: 9fans

On Mon Apr 24 21:16:57 CDT 2006, dfawcus@cisco.com wrote:
> On Mon, Apr 24, 2006 at 02:37:21PM -0600, Ronald G Minnich wrote:
> > This program:
> >
> > compiles to a 512KB binary on linux with -static
>
> glibc is bloated,  printf and strtoul are also quite large.  [..,]

noooo.... you're kidding, right?

this is the gnu fallacy in action.  nobody can find a theoretical algorithmic weakness,
so it must be better. (my take: if it's sufficiently complicated, it can't be
criticized by anybody who understands it.  proof: nobody has enough time to understand
it. qed.)

	; wc -l /sys/src/sys/src/libc/port/strstr.c
	29 /sys/src/libc/port/strstr.c

	; wc -l $home/glibc-2.3.5/sysdeps/generic/strstr.c
	123 /home/quanstro/glibc-2.3.5/sysdeps/generic/strstr.c

the gnu strstr is really slick and exploits many tricks, but it's 4-5x bigger
than the plan 9 version.  i would venture to guess that for the common case
of smallish searches on typically cache-bound systems, the plan 9 version
beats the pants off the glibc version.  (and, if you follow the thinking through
to a whole library, you start thinking that dynamic libraries and other complicated
cheats are good ideas.)

- erik


^ permalink raw reply	[flat|nested] 69+ messages in thread
* [9fans] impressive
@ 2006-04-24 20:37 Ronald G Minnich
  2006-04-24 20:51 ` Charles Forsyth
                   ` (2 more replies)
  0 siblings, 3 replies; 69+ messages in thread
From: Ronald G Minnich @ 2006-04-24 20:37 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

This program:

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#include <unistd.h>
#include <stdio.h>

main (int argc, char *argv[])
{
     unsigned char buf[8], *p;
     int fd_msr, i;
     unsigned long addr = 0;

     if (argc < 3) {
         printf("usage:wrmsr reg value\n");
         exit(1);
     }
     addr = strtoul(argv[1], NULL, 0);
     p = argv[2];

     printf("MSR register 0x%lx => ", addr);
     for (i = 7; i > 0; i--) {
         buf[i] = strtol(p, &p, 16);
         p++;
         printf("%2.2x:", buf[i]);
     }
     buf[i] = strtol(p, &p, 16);
     printf("%2.2x\n", buf[i]);

     fd_msr = open("/dev/cpu/0/msr", O_WRONLY);
     lseek(fd_msr, addr, SEEK_SET);
     if (write(fd_msr, buf, 8) < 0)
         perror("");
}

compiles to a 512KB binary on linux with -static

Well, *I'm* impressed anyway.

[[ standard old guy story about "my first Unix box" and "nobody knows
the value of 2 bits anymore" and "what's with these GNU kids today"
deleted -- ed.]]

yy* symbols are in there btw. And, don't worry, some pthreads symbols
made it in as well. Don't want main() to be too lonely!

ron


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

end of thread, other threads:[~2006-05-10  8:39 UTC | newest]

Thread overview: 69+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-26  0:26 [9fans] impressive erik quanstrom
2006-04-26  0:48 ` geoff
2006-04-26  0:54   ` Roman Shaposhnick
2006-04-26  0:53 ` Roman Shaposhnick
2006-04-26  2:15   ` Taj Khattra
2006-04-26  4:59     ` David Leimbach
2006-04-26 12:37       ` Anthony Sorace
2006-04-26 15:28     ` Rian Hunter
2006-04-26 16:39     ` Micah Stetson
2006-04-26 18:02       ` Bruce Ellis
2006-04-26 20:14         ` Micah Stetson
2006-05-08 14:50       ` Harri Haataja
2006-05-08 15:04         ` LiteStar numnums
2006-05-08 15:12           ` Charles Forsyth
2006-05-08 20:08             ` Micah Stetson
2006-05-08 20:52             ` LiteStar numnums
2006-05-08 21:10               ` Jack Johnson
2006-05-08 21:17                 ` andrey mirtchovski
2006-05-08 21:18                 ` Paul Lalonde
2006-05-08 22:25                 ` Francisco J Ballesteros
2006-05-09 21:56                   ` Dave Eckhardt
2006-05-10  0:13                     ` geoff
2006-05-10  8:39                       ` Lluís Batlle
2006-05-08 23:31                 ` geoff
2006-05-09  1:18                   ` Paul Lalonde
2006-05-09  1:39                     ` quanstro
2006-05-09  2:12                       ` Paul Lalonde
2006-05-09  2:20                         ` quanstro
2006-05-09  3:00                           ` Paul Lalonde
2006-05-09  9:32                             ` Bruce Ellis
2006-04-26 22:57     ` Roman Shaposhnick
2006-04-26  4:57 ` David Leimbach
2006-04-26  4:53   ` Ronald G Minnich
2006-04-26  5:11     ` Roman Shaposhnick
  -- strict thread matches above, loose matches on Subject: below --
2006-05-10  0:45 erik quanstrom
2006-05-10  2:09 ` Lyndon Nerenberg
2006-05-10  3:35   ` David Arnold
2006-05-10  4:03     ` Lyndon Nerenberg
2006-05-08 22:02 erik quanstrom
2006-04-27  2:13 erik quanstrom
2006-04-27  1:35 erik quanstrom
2006-04-27  1:23 erik quanstrom
2006-04-27  5:08 ` Micah Stetson
2006-04-27  1:10 erik quanstrom
2006-04-27  2:06 ` Jack Johnson
2006-04-26  3:24 jmk
2006-04-26  2:38 erik quanstrom
2006-04-26  0:55 erik quanstrom
2006-04-26  1:07 ` Roman Shaposhnick
2006-04-25 10:20 erik quanstrom
2006-04-25  2:30 erik quanstrom
2006-04-25  2:48 ` Derek Fawcus
2006-04-24 20:37 Ronald G Minnich
2006-04-24 20:51 ` Charles Forsyth
2006-04-24 21:32 ` Brantley Coile
2006-04-25 11:06   ` Anthony Sorace
2006-04-25 11:08     ` Anthony Sorace
2006-04-25  2:15 ` Derek Fawcus
2006-04-25  2:23   ` Roman Shaposhnick
2006-04-25  2:37     ` Derek Fawcus
2006-04-25  3:51       ` Roman Shaposhnick
2006-04-25  8:17         ` Derek Fawcus
2006-04-25 17:53           ` Roman Shaposhnick
2006-04-26  1:11             ` Derek Fawcus
2006-04-26  1:19               ` Roman Shaposhnick
2006-04-26  2:12                 ` Derek Fawcus
2006-04-25  3:02   ` Andy Newman
2006-04-25  3:13     ` Ronald G Minnich
2006-04-25 19:57     ` Dan Cross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).