Date: Wed, 3 Nov 2004 00:04:18 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 436 ************************************************** Tuesday 02 November 2004 Number 436 ************************************************** Subjects for today 1 Re: GCC 3.3.4 problem : John Poltorak 2 Re: GCC 3.3.4 problem : Stefan.Neis at t-online.de 3 Re: GCC 3.3.4 problem : John Poltorak 4 Re: GCC 3.3.4 problem : Stefan.Neis at t-online.de 5 Re: GCC 3.3.4 problem : John Poltorak 6 Re: GCC 3.3.4 problem : Henry Sobotka 7 Re: GCC 3.3.4 problem : John Poltorak 8 Re: GCC 3.3.4 problem : Henry Sobotka 9 Re: GCC 3.3.4 problem : John Poltorak 10 Re: GCC 3.3.4 problem : Knut St. Osmundsen" 1 Re: GCC 3.3.4 problem : Henry Sobotka 11 Re: Warpzilla Build Instructions : Knut St. Osmundsen" 2 Re: GCC 3.3.4 problem : John Poltorak **= Email 1 ==========================** Date: Mon, 1 Nov 2004 14:02:55 +0000 From: John Poltorak Subject: Re: GCC 3.3.4 problem On Mon, Nov 01, 2004 at 12:33:38PM +0100, Stefan.Neis at t-online.de wrote: > Hi, > > > config.h does not contain this string. What I need to do currently under > > gcc 2.8.1 is to add > > > > -Dstrncasecmp=strnicmp -Dstrcasecmp=stricmp > > > > to CFLAGS. > > So omitting those when using Innotek's libc should help. I may have overlooked something here.... PDKSH come with a hardcoded config.h which is copied into place whilst building.... grrrrr!!!! > > This is a line of code in os2.c:- > > > > if (_emx_env & 0x1000) { /* RSX, do best we can do. */ > > > > > > What is the best way of getting round it? > > According to emx' documentation 0x1000 indicates that it's running > under RSX which will never be the case for stuff compiled with > Innotek, so "if (0) {" (or removing the whole block of RSX-code) > seems like a good solution. Do you mean removing the whole of this block (in os2.c):- ? if (_emx_env & 0x1000) { /* RSX, do best we can do. */ int len = strlen(cmd); if (len > 4 && stricmp(cmd + len - 4, ".bat") == 0) { /* execve would fail anyway, but most probably segfault. */ errno = ENOEXEC; return -1; } goto do_execve; } Maybe even the following block:- if ( inDOS() ) { fprintf(stderr, "ksh_execve requires OS/2 or RSX!\n"); exit(255); } There's also this define in sh.h:- #ifdef OS2 # define inDOS() (!(_emx_env & 0x200)) #endif > Regards, > Stefan > > -- John **= Email 2 ==========================** Date: Mon, 1 Nov 2004 14:38:22 +0100 From: Stefan.Neis at t-online.de Subject: Re: GCC 3.3.4 problem Hi, > Do you mean removing the whole of this block (in os2.c):- ? > > if (_emx_env & 0x1000) { /* RSX, do best we can do. */ > int len = strlen(cmd); > > if (len > 4 && stricmp(cmd + len - 4, ".bat") == 0) { > /* execve would fail anyway, but most probably segfault. */ > errno = ENOEXEC; > return -1; > } > goto do_execve; > } > > Maybe even the following block:- > > if ( inDOS() ) { > fprintf(stderr, "ksh_execve requires OS/2 or RSX!\n"); > exit(255); > } > > There's also this define in sh.h:- > > #ifdef OS2 > # define inDOS() (!(_emx_env & 0x200)) > #endif Yes, all of this can go away when we're using Innotek's compiler. Stefan P.S.: Perhaps, something like static __const__ unsigned int _emx_env = 0x0200; should/could be added to Innotek headers, but as long as we know about only one app which wants to use it, there's not much point in doing that... **= Email 3 ==========================** Date: Mon, 1 Nov 2004 18:19:42 +0000 From: John Poltorak Subject: Re: GCC 3.3.4 problem On Mon, Nov 01, 2004 at 02:38:22PM +0100, Stefan.Neis at t-online.de wrote: > Yes, all of this can go away when we're using Innotek's compiler. > > Stefan > > P.S.: Perhaps, something like > static __const__ unsigned int _emx_env = 0x0200; > should/could be added to Innotek headers, but as long > as we know about only one app which wants to use it, > there's not much point in doing that... I guess it would be useful having something like a log changes required... As for PDKSH, my latest build after making the changes mentioned resulted in this:- makefile:158: warning: overriding commands for target `TAGS' makefile:155: warning: ignoring old commands for target `TAGS' gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 os2.c gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 alloc.c gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 c_ksh.c gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 c_sh.c gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 c_test.c gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 c_ulimit.c gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 edit.c cmd /c copy .\os2\emacs.out emacs.out > nul touch emacs.out gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 emacs.c gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 eval.c gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 exec.c exec.c: In function `scriptexec': exec.c:750: error: parse error before ')' token exec.c:754: error: parse error before ')' token make: *** [exec.o] Error 1 makefile:158: warning: overriding commands for target `TAGS' makefile:155: warning: ignoring old commands for target `TAGS' ../mkinstalldirs t:/usr/bin t:/usr/share/man/man1 gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 exec.c exec.c: In function `scriptexec': exec.c:750: error: parse error before ')' token exec.c:754: error: parse error before ')' token make: *** [exec.o] Error 1 exec.c:- static void scriptexec(tp, ap) register struct op *tp; register char **ap; { char *shell; shell = str_val(global(EXECSHELL_STR)); // <==== line 750 if (shell && *shell) shell = search(shell, path, X_OK, (int *) 0); if (!shell || !*shell) shell = EXECSHELL; *tp->args-- = tp->str; #ifdef SHARPBANG { Any clues? -- John **= Email 4 ==========================** Date: Mon, 1 Nov 2004 19:18:36 +0100 From: Stefan.Neis at t-online.de Subject: Re: GCC 3.3.4 problem Hi, > gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 exec.c > exec.c: In function `scriptexec': > exec.c:750: error: parse error before ')' token > exec.c:754: error: parse error before ')' token > make: *** [exec.o] Error 1 > makefile:158: warning: overriding commands for target `TAGS' > makefile:155: warning: ignoring old commands for target `TAGS' > ../mkinstalldirs t:/usr/bin t:/usr/share/man/man1 > gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 exec.c > exec.c: In function `scriptexec': > exec.c:750: error: parse error before ')' token > exec.c:754: error: parse error before ')' token > make: *** [exec.o] Error 1 > shell = str_val(global(EXECSHELL_STR)); // <==== line 750 > if (shell && *shell) > shell = search(shell, path, X_OK, (int *) 0); > if (!shell || !*shell) > shell = EXECSHELL; I would guess, EXECSHELL and EXECSHELL_STR are supposed to get defined somewhere in pdksh's headers, but don't get defined (or get defined to some error-inducing dummy value) for whatever reason. Regards, Stefan **= Email 5 ==========================** Date: Mon, 1 Nov 2004 20:06:42 +0000 From: John Poltorak Subject: Re: GCC 3.3.4 problem On Mon, Nov 01, 2004 at 07:18:36PM +0100, Stefan.Neis at t-online.de wrote: > I would guess, EXECSHELL and EXECSHELL_STR are supposed to get > defined somewhere in pdksh's headers, but don't get defined > (or get defined to some error-inducing dummy value) for whatever > reason. Oops, my fault - there was a typo on one of the patches applied. That one is sorted, now I get this:- cmd /c copy .\os2\os2siglist.out siglist.out > nul touch siglist.out gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 trap.c gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 tree.c gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 tty.c gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 var.c gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 version.c gcc -c -DHAVE_CONFIG_H -I. -I. -O -DOS2 vi.c gcc -O -s -o sh.exe os2.o alloc.o c_ksh.o c_sh.o c_test.o c_ulimit.o edit.o emacs.o eval.o exec.o expr.o history.o io.o jobs.o lex.o mail.o main.o misc.o missing.o path.o shf.o sigact.o syn.o table.o trap.o tree.o tty.o var.o version.o vi.o -los2 os2.o: Undefined symbol _WinQuerySwitchHandle referenced from text segment os2.o: Undefined symbol _WinQuerySwitchEntry referenced from text segment os2.o: Undefined symbol _WinChangeSwitchEntry referenced from text segment os2.o: Undefined symbol _WinChangeSwitchEntry referenced from text segment make: *** [sh.exe] Error 1 makefile:158: warning: overriding commands for target `TAGS' makefile:155: warning: ignoring old commands for target `TAGS' ../mkinstalldirs t:/usr/bin t:/usr/share/man/man1 gcc -O -s -o sh.exe os2.o alloc.o c_ksh.o c_sh.o c_test.o c_ulimit.o edit.o emacs.o eval.o exec.o expr.o history.o io.o jobs.o lex.o mail.o main.o misc.o missing.o path.o shf.o sigact.o syn.o table.o trap.o tree.o tty.o var.o version.o vi.o -los2 os2.o: Undefined symbol _WinQuerySwitchHandle referenced from text segment os2.o: Undefined symbol _WinQuerySwitchEntry referenced from text segment os2.o: Undefined symbol _WinChangeSwitchEntry referenced from text segment os2.o: Undefined symbol _WinChangeSwitchEntry referenced from text segment make: *** [sh.exe] Error 1 > Regards, > Stefan -- John **= Email 6 ==========================** Date: Mon, 01 Nov 2004 15:13:24 -0500 From: Henry Sobotka Subject: Re: GCC 3.3.4 problem John Poltorak wrote: > > os2.o: Undefined symbol _WinQuerySwitchHandle referenced from text segment > os2.o: Undefined symbol _WinQuerySwitchEntry referenced from text segment > os2.o: Undefined symbol _WinChangeSwitchEntry referenced from text segment > os2.o: Undefined symbol _WinChangeSwitchEntry referenced from text segment Those are OS/2 API calls. My guess is that you have to add libc05 or libc06 or whatever it is to LIBS for linkage. h~ **= Email 7 ==========================** Date: Mon, 1 Nov 2004 22:01:29 +0000 From: John Poltorak Subject: Re: GCC 3.3.4 problem On Mon, Nov 01, 2004 at 03:13:24PM -0500, Henry Sobotka wrote: > John Poltorak wrote: > > > > os2.o: Undefined symbol _WinQuerySwitchHandle referenced from text segment > > os2.o: Undefined symbol _WinQuerySwitchEntry referenced from text segment > > os2.o: Undefined symbol _WinChangeSwitchEntry referenced from text segment > > os2.o: Undefined symbol _WinChangeSwitchEntry referenced from text segment > > Those are OS/2 API calls. My guess is that you have to add libc05 or > libc06 or whatever it is to LIBS for linkage. So I need to change the Makefile by adding -l( + one of these) libc_alias.a libc_alias.lib libc_app.a libc_app.lib libc_app_l.a libc_app_l.lib libc_app_p.a libc_app_p.lib libc_dll.a libc_dll.lib libc_l_s.a libc_l_s.lib libc_p_s.a libc_p_s.lib libc_s.a libc_s.lib to this line... LIBS = -los2 How do I know which one? > h~ -- John **= Email 8 ==========================** Date: Mon, 01 Nov 2004 16:38:19 -0500 From: Henry Sobotka Subject: Re: GCC 3.3.4 problem John Poltorak wrote: > > So I need to change the Makefile by adding -l( + one of these) > [snip] > > to this line... > > LIBS = -los2 Yes. > How do I know which one? emxexp libc_[...your choice...].a | grep Switch Try app_p first as the _p could be for PM. h~ **= Email 9 ==========================** Date: Mon, 1 Nov 2004 23:21:17 +0000 From: John Poltorak Subject: Re: GCC 3.3.4 problem On Mon, Nov 01, 2004 at 04:38:19PM -0500, Henry Sobotka wrote: > John Poltorak wrote: > > > > So I need to change the Makefile by adding -l( + one of these) > > > [snip] > > > > to this line... > > > > LIBS = -los2 > > Yes. > > > How do I know which one? > > emxexp libc_[...your choice...].a | grep Switch > > Try app_p first as the _p could be for PM. The only lib containing Switch was libos2_p.a which contained:- "WinAddSwitchEntry" ; magicseg='TEXT32' len=17 "WinChangeSwitchEntry" ; magicseg='TEXT32' len=20 "WinCreateSwitchEntry" ; magicseg='TEXT32' len=20 "WinQuerySwitchEntry" ; magicseg='TEXT32' len=19 "WinQuerySwitchHandle" ; magicseg='TEXT32' len=20 "WinQuerySwitchList" ; magicseg='TEXT32' len=18 "WinRemoveSwitchEntry" ; magicseg='TEXT32' len=20 "WinSwitchProgramRegister" ; magicseg='TEXT32' len=24 "WinSwitchToProgram" ; magicseg='TEXT32' len=18 Changing the LIBS to -llibos2_p.a resulted in:- makefile:158: warning: overriding commands for target `TAGS' makefile:155: warning: ignoring old commands for target `TAGS' os2.o: Undefined symbol _WinQuerySwitchHandle referenced from text segment os2.o: Undefined symbol _WinQuerySwitchEntry referenced from text segment os2.o: Undefined symbol _WinChangeSwitchEntry referenced from text segment os2.o: Undefined symbol _WinChangeSwitchEntry referenced from text segment T:/usr/lib/libos2_p.a(IMPORT#74): Undefined symbol __mcount referenced from text segment T:/usr/lib/libos2_p.a(IMPORT#80): Undefined symbol __mcount referenced from text segment T:/usr/lib/libos2_p.a(IMPORT#130): Undefined symbol __mcount referenced from text segment T:/usr/lib/libos2_p.a(IMPORT#1045): Undefined symbol __mcount referenced from text segment T:/usr/lib/libos2_p.a(IMPORT#1050): Undefined symbol __mcount referenced from text segment T:/usr/lib/libos2_p.a(IMPORT#1087): Undefined symbol __mcount referenced from text segment T:/usr/lib/libos2_p.a(IMPORT#1088): Undefined symbol __mcount referenced from text segment T:/usr/lib/libos2_p.a(IMPORT#1568): Undefined symbol __mcount referenced from text segment T:/usr/lib/libos2_p.a(IMPORT#1621): Undefined symbol __mcount referenced from text segment make: *** [sh.exe] Error 1 This is getting a little frustrating... > h~ -- John **= Email 10 ==========================** Date: Tue, 02 Nov 2004 01:09:40 +0100 From: "Knut St. Osmundsen" Subject: Re: GCC 3.3.4 problem John Poltorak wrote: > On Mon, Nov 01, 2004 at 04:38:19PM -0500, Henry Sobotka wrote: > >>John Poltorak wrote: >> >>>So I need to change the Makefile by adding -l( + one of these) >>> >> >>[snip] >> >>>to this line... >>> >>>LIBS = -los2 This is a default library, just like -lc, -lc_alias, -lc_app and -lgcc. >>Yes. >> >> >>>How do I know which one? >> >>emxexp libc_[...your choice...].a | grep Switch >> >>Try app_p first as the _p could be for PM. This suffix is - and has always been - for profiling. > The only lib containing Switch was libos2_p.a which contained:- > > > "WinAddSwitchEntry" ; magicseg='TEXT32' len=17 > "WinChangeSwitchEntry" ; magicseg='TEXT32' len=20 > "WinCreateSwitchEntry" ; magicseg='TEXT32' len=20 > "WinQuerySwitchEntry" ; magicseg='TEXT32' len=19 > "WinQuerySwitchHandle" ; magicseg='TEXT32' len=20 > "WinQuerySwitchList" ; magicseg='TEXT32' len=18 > "WinRemoveSwitchEntry" ; magicseg='TEXT32' len=20 > "WinSwitchProgramRegister" ; magicseg='TEXT32' len=24 > "WinSwitchToProgram" ; magicseg='TEXT32' len=18 > > Changing the LIBS to -llibos2_p.a resulted in:- > > makefile:158: warning: overriding commands for target `TAGS' > makefile:155: warning: ignoring old commands for target `TAGS' > os2.o: Undefined symbol _WinQuerySwitchHandle referenced from text segment > os2.o: Undefined symbol _WinQuerySwitchEntry referenced from text segment > os2.o: Undefined symbol _WinChangeSwitchEntry referenced from text segment > os2.o: Undefined symbol _WinChangeSwitchEntry referenced from text segment The '_' means your calling the OS/2 api using the wrong prototypes. The most usual case is the os2.h / os2emx.h isn't included and the API is either prototyped directly in the source or not prototyped at all. Adding something like this to the include section of os2.c should do it: #define INCL_WIN #include Kind Regards, knut **= Email 1 ==========================** Date: Mon, 01 Nov 2004 18:10:23 -0500 From: Henry Sobotka Subject: Re: GCC 3.3.4 problem John Poltorak wrote: > [snip] > > This is getting a little frustrating... The errors suggest there's probably some higher-level way of linking with the OS/2 API. If there's nothing about it in the gcc 3.3.4 docs, take a look at /config/autoconf.mk in your mozilla objdir if you still have it and see what libs are used there. h~ **= Email 11 ==========================** Date: Tue, 02 Nov 2004 01:18:28 +0100 From: "Knut St. Osmundsen" Subject: Re: Warpzilla Build Instructions Stefan.Neis at t-online.de wrote: > Hi, > > >>Why? I thought the standard C calling convention was to pass >>all arguments by the stack unless you specify some very special >>optimization flag to use registers for this. > > > AFAIK, Innotek uses "optlink" by default (probably following what > VAC++ did...), while EMX used standard convention. But I just might > be confused ... No, we don't. BUT we use the same namemangling for a.out and OMF, and we don't have any underscore prefix hacks for importlibraries and stuff like EMX had. Kind Regards, knut **= Email 2 ==========================** Date: Tue, 2 Nov 2004 10:38:48 +0000 From: John Poltorak Subject: Re: GCC 3.3.4 problem On Tue, Nov 02, 2004 at 01:09:40AM +0100, Knut St. Osmundsen wrote: > John Poltorak wrote: > >>>LIBS = -los2 > > This is a default library, just like -lc, -lc_alias, -lc_app and -lgcc. OK - it works fine now following your instructions below. > Adding something like this to the include section of os2.c should do it: > #define INCL_WIN This made the difference and PDKSH will compile although sh.exe crashes most of the time - having to readjust the computer's time does make it a bit awkward to use too... Here is an entry from POPUPLOG.OS2:- 10-31-2004 01:33:53 SYS3176 PID 45ef TID 0001 Slot 0059 T:\UX2BS\WORKDIR\PDKSH-5.2.14\SH.EXE c000001c 1ee89014 EAX=029338ec EBX=02935008 ECX=00000000 EDX=000305f0 ESI=00000001 EDI=029338d0 DS=0053 DSACC=f0f3 DSLIM=ffffffff ES=0053 ESACC=f0f3 ESLIM=ffffffff FS=150b FSACC=00f3 FSLIM=00000030 GS=0000 GSACC=**** GSLIM=******** CS:EIP=005b:1ee89014 CSACC=f0df CSLIM=ffffffff SS:ESP=0053:0283fb60 SSACC=f0f3 SSLIM=ffffffff EBP=0283fd68 FLG=00012206 LIBC06A2.DLL 0001:00019014 > Kind Regards, > knut -- John