Disable default libc #778
Replies: 36 comments
-
Done a bit more testing and got the following: C:\Users\robertapengelly\Desktop\test>wcl -ecc -q -w -c -mt -zl -fpi87 -s -zdp -zu temp.c C:\Users\robertapengelly\Desktop\test>wlink F { temp.obj } Form dos com N test.bin The C file looks like: #include <stdio.h> void lilo_main (void) { The behavour is somewhat what I expect where printf isn't found but I don't expect stdio.h to be found either unless I'm proving it myself, am I missing something? GCC has the -nostdinc flag but I can't seem to find anything in wcl help other than -zl and -zld but they both find stdio.h. |
Beta Was this translation helpful? Give feedback.
-
I don't know what you want to do. If you want to use compiled code without OW CRTL then it can be a little harder then only remove reference to OW run-time libraries. |
Beta Was this translation helpful? Give feedback.
-
What I'm trying to do is not rely on the OW libc at all. Lets say I'm creating an operating system and I'm creating my own libc I want to only get headers from my implementation not from OW. |
Beta Was this translation helpful? Give feedback.
-
OK. |
Beta Was this translation helpful? Give feedback.
-
Yeah I get that but say I use typedef size_t long in stddef.h and use #include <string.h> without creating it then OW tries to load the string.h included with itself and complains that size_t is already defined instead of complaining that string.h doesn't exist. |
Beta Was this translation helpful? Give feedback.
-
Sorry, but if you plan to have your own CRTL then you must create your own header files, because they are not independent. |
Beta Was this translation helpful? Give feedback.
-
Maybe I didn't understand you. If you want to not use header files then cleanup INCLUDE environment variable which point to system header files directories or setup it to what you need. |
Beta Was this translation helpful? Give feedback.
-
I know I need to create my own headers but the problem is that OW still looks in its lh folder for the headers as well which is what I'm trying to stop. GCC has a -nostdinc option which means that it won't use any system headers and I'm asking if OW has a similar feature. If I remove the environment variable then I won't be able to use OW in other projects unless I add it again which will be going round in circles remove it for one project, add it for another and the loop will continue. |
Beta Was this translation helpful? Give feedback.
-
It is not possible, it signal some OW misconfiguration. |
Beta Was this translation helpful? Give feedback.
-
Anyway don't expect same solution as GCC. |
Beta Was this translation helpful? Give feedback.
-
I weren't expecting the same solution I was expecting an OW equivalent. I get that OW is older and a cross-compiler I just thought maybe there would be a flag to ignore the lh directory. |
Beta Was this translation helpful? Give feedback.
-
it has nothing to do with lh directory. |
Beta Was this translation helpful? Give feedback.
-
Trying to build on linux gives: robertapengelly@RAP1505-UBUNTU:~/Desktop/test$ wcl -ecc -q -w -c -mt -zl -zdl -fpi87 -s -zdp -zu temp.c The same happened earlier on Windows and thats installed using the installer on here. |
Beta Was this translation helpful? Give feedback.
-
don't ask me to resolve your code bugs. |
Beta Was this translation helpful? Give feedback.
-
I don't have code bugs I have like 3 lines of code: typedef long size_t; void main (void) {} I'm trying to get OW to ignore the default headers. |
Beta Was this translation helpful? Give feedback.
-
Ohh the x is for wcl I thought you were telling me to recompile the project as you said "It is not possible, it signal some OW misconfiguration". Sorry a bit of misunderstanding. I must have skipped past that flag when I was searching the help. Problem solved. |
Beta Was this translation helpful? Give feedback.
-
Here is appropriate part of OW documentation which describe include files processing in OW. |
Beta Was this translation helpful? Give feedback.
-
Passing -x to wcl did what I wanted so the problem is solved. I must have missed it when I was looking at wcl help. |
Beta Was this translation helpful? Give feedback.
-
It is difference OW 2 against OW1.9 that -x option works same way for all tools including resource compiler.
|
Beta Was this translation helpful? Give feedback.
-
WCL tool is not suitable for your purpose now, because it use predefined linker definition for OW run-time libraries. |
Beta Was this translation helpful? Give feedback.
-
Yeah I know about wlink e.g. wlink F { temp.obj } Form dos com N test.sys. I just didn't notice the -x flag in wcl nor wcc help. |
Beta Was this translation helpful? Give feedback.
-
No, -x is useful in both. By example, we use for OW build custom build/wlink.lnk which is completely different from standard distribution. or by wcl with option -l=rex_linux By default such target is not supported by OW. Appropriate definition of such target in wlink.lnk is
|
Beta Was this translation helpful? Give feedback.
-
Not related to my problem the other day but considering this is still open how do you define variables for WASM. I've tried both "%define temp 4" and "#define temp 4" but they both give me "test.asm(9): Error! E032: Syntax error". |
Beta Was this translation helpful? Give feedback.
-
Such constructs are invalid. |
Beta Was this translation helpful? Give feedback.
-
The first one is from NASM and I know the second one was from C but thought I'd try it anyway. I know that MASM has = and equ which work great for numerical values but say I wanted test = (bp - 2) then that's not numerical and I get Error! E069: Illegal use of register for both = and equ. If I use equ in NASM i get "error: bad syntax for EQU" which is where the %define test (bp - 2) comes in handy and I'm asking if WASM (or MASM) has an alternative or would I be better off sticking with NASM? |
Beta Was this translation helpful? Give feedback.
-
It is different world, you must decided what you want. |
Beta Was this translation helpful? Give feedback.
-
I'm not using it anywhere take the following: % .model memodel temp = (bp - 2) _TEXT segment public 'CODE' end cstart I'm getting 'test.wasm(3): Error! E069: Illegal use of register' which indicates that I can't use bp with = and I've searched the web for over the last couple of days but can't find anything that helps. |
Beta Was this translation helpful? Give feedback.
-
This 3 line is source of problem, it is garbage in MASM temp = (bp - 2) You need to learn MASM macro assembler, |
Beta Was this translation helpful? Give feedback.
-
I'm trying to use WASM not MASM. % .model memodel temp = 2 _TEXT segment public 'CODE' end cstart Compiles no problem with 'wasm -zq -zcm -fo=.obj -Dmemodel=tiny test.wasm' % .model memodel temp = (bp - 2) _TEXT segment public 'CODE' end cstart Gives me 'test.wasm(3): Error! E069: Illegal use of register'. I'm asking if there's an alternative to NASM's %define so I can use a register and offset (e.g. bp - 2) instead of hard coding it where they are needed? |
Beta Was this translation helpful? Give feedback.
-
I've finally solved the problem partly, if WASM is MASM syntax then how come the following doesn't build? ;% .model memodel TxtEqu equ <11[bp]> _TEXT segment word public 'CODE' public start
bpb db 03ch dup(?) bypass:
start endp writehex proc
writehex_loop:
writehex_low:
writehex_high:
writehex_ischar:
writehex_done:
writehex endp org 01FEh _TEXT ends end top MASM compiled and does as expected but wasm gives me: robertapengelly@RAP1505-UBUNTU:~/Desktop/test 01/temp$ wasm -zq -zcm -fo=.obj -Dmemodel=tiny TEST.ASM |
Beta Was this translation helpful? Give feedback.
-
I'm trying to disable using the watcom libc.
Help shows:
-zl remove default library information
But it's still looking into the watcom libc. Is this a bug or am I using the wrong flag?
Beta Was this translation helpful? Give feedback.
All reactions