Re: [uCsimm] compiled program with elf-gcc doesn't work

From: cedric.delfosse@freealter.com
Date: Thu Jun 21 2001 - 09:20:37 EDT


Quoting David Jones <spd_racer911@yahoo.com>:

>
> Hi Cedric,
> Did you need to make any changes to "links" to get it to compile and
> run on your uCsimm ?? If so could you share with us the modifications
> ?
>
> Thanks,
> David

Hi David,
Some little changes were needed. Here is the diff

diff -r links-0.84 links-0.84.m68k
diff -r links-0.84/default.c links-0.84.m68k/default.c
23c23
< struct option {

---
> struct Option {
34c34
< struct option options[];
---
> struct Option options[];
254c253
< void add_nm(struct option *o, unsigned char **s, int *l)
---
> void add_nm(struct Option *o, unsigned char **s, int *l)
261c260
< unsigned char *num_rd(struct option *o, unsigned char *c)
---
> unsigned char *num_rd(struct Option *o, unsigned char *c)
271c270
< void num_wr(struct option *o, unsigned char **s, int *l)
---
> void num_wr(struct Option *o, unsigned char **s, int *l)
277c276
< unsigned char *str_rd(struct option *o, unsigned char *c)
---
> unsigned char *str_rd(struct Option *o, unsigned char *c)
284c283
< void str_wr(struct option *o, unsigned char **s, int *l)
---
> void str_wr(struct Option *o, unsigned char **s, int *l)
291c290
< unsigned char *cp_rd(struct option *o, unsigned char *c)
---
> unsigned char *cp_rd(struct Option *o, unsigned char *c)
300c299
< void cp_wr(struct option *o, unsigned char **s, int *l)
---
> void cp_wr(struct Option *o, unsigned char **s, int *l)
348c347
< unsigned char *type_rd(struct option *o, unsigned char *c)
---
> unsigned char *type_rd(struct Option *o, unsigned char *c)
382c381
< void type_wr(struct option *o, unsigned char **s, int *l)
---
> void type_wr(struct Option *o, unsigned char **s, int *l)
399c398
< unsigned char *ext_rd(struct option *o, unsigned char *c)
---
> unsigned char *ext_rd(struct Option *o, unsigned char *c)
417c416
< void ext_wr(struct option *o, unsigned char **s, int *l)
---
> void ext_wr(struct Option *o, unsigned char **s, int *l)
428c427
< unsigned char *term_rd(struct option *o, unsigned char *c)
---
> unsigned char *term_rd(struct Option *o, unsigned char *c)
463c462
< unsigned char *term2_rd(struct option *o, unsigned char *c)
---
> unsigned char *term2_rd(struct Option *o, unsigned char *c)
502c501
< void term2_wr(struct option *o, unsigned char **s, int *l)
---
> void term2_wr(struct Option *o, unsigned char **s, int *l)
521c520
< unsigned char *gen_cmd(struct option *o, unsigned char ***argv, int *argc)
---
> unsigned char *gen_cmd(struct Option *o, unsigned char ***argv, int *argc)
528c527
< unsigned char *lookup_cmd(struct option *o, unsigned char ***argv, int *argc) ---
> unsigned char *lookup_cmd(struct Option *o, unsigned char ***argv, int *argc)
598c597
< struct option options[] = {
---
> struct Option options[] = {
diff -r links-0.84/os_dep.c links-0.84.m68k/os_dep.c
129c130
<       if (!fork()) {
---
>       if (!vfork()) {
diff -r links-0.84/os_dep.h links-0.84.m68k/os_dep.h
30a31
> #define NO_ASYNC_LOOKUP 1
diff -r links-0.84/session.c links-0.84.m68k/session.c
462c462
<       unsigned char *nm = tempnam(NULL, "links");
---
>       unsigned char *nm = "links123";

struct option is already defined in getopt.h, that's why the compiler complains and you need to rename it. fork() doesn't exist in the uClibc for uCsimm, so I use vfork(). tempnam doesn't exist too, so I give to the temporary filename a arbitrary name. And ASYNC_LOOKUP doesn't work.

the configure line is:

CC=m68k-elf-gcc CFLAGS="-msep-data -O2 -m68000 -fomit-frame-pointer" LIBS="-lc" LDFLAGS="-Wl,-elf2flt" ./configure

But be careful. Links is rather slow and it takes a lot of memory when it loads a web page. links seems to forget to release the memory it allocates.

I hope this will work for you !

CÚdric Delfosse Free & Alter Soft (http://freealter.com)

This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:43 EST