Author Topic: How to specify wlink as linker for gcc?  (Read 8807 times)

R.M. Klippstein

  • Sr. Member
  • ****
  • Posts: 313
  • Karma: +3/-0
    • View Profile
How to specify wlink as linker for gcc?
« on: May 29, 2014, 01:38:29 am »
I'm using Paul's gcc 3.3.5 and 4.8.2, I need to use wlink but can't seem to figure out how to get gcc to use it (wl.exe and its included patch). I need to set EMXOMFLD_LINKER=wl.exeand EMXOMFLD_TYPE=WLINK -- do I do this as a SET command in config.sys or enter it using wl.exe at its prompt?
Thanks for any help.  klipp

Andy Willis

  • Sr. Member
  • ****
  • Posts: 292
  • Karma: +7/-0
    • View Profile
Re: How to specify wlink as linker for gcc?
« Reply #1 on: May 29, 2014, 04:21:22 am »
It can be done in the config.sys but generally is done in a script to setup your environment.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4788
  • Karma: +99/-1
    • View Profile
Re: How to specify wlink as linker for gcc?
« Reply #2 on: May 29, 2014, 04:32:55 am »
You can just do it at the command prompt or as Andy said, as part of a script to set up the environment.
Note that you also have to use -Zomf as a linking flag or else gcc will default to calling ld.exe for linking

R.M. Klippstein

  • Sr. Member
  • ****
  • Posts: 313
  • Karma: +3/-0
    • View Profile
Re: How to specify wlink as linker for gcc?
« Reply #3 on: May 29, 2014, 06:55:12 pm »
Hey, Thanks to both of you, that got me over another "bump in the road" on my way to trying to compile a newer version of VBox -- so far its been pretty much of a disaster but I am slowly making progress.(very slowly!) Do either of you know if anybody else is attempting this  "Fantasy Project"? It would be encouraging to know I'm not alone in this possibly futile endeavor.

klipp

Andi B.

  • Hero Member
  • *****
  • Posts: 811
  • Karma: +11/-2
    • View Profile
Re: How to specify wlink as linker for gcc?
« Reply #4 on: May 30, 2014, 10:10:49 am »
Did you try the yum/rpm route with gcc? Over the years I tried gcc now and then. At first downloaded Pauls environment and later with DVDs from him. But nowadays I only use the yum/rpm installation. Not sure if 'yum install gcc-wlink' and 'yum install watcom-wlink-hll' will do what you need though.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4788
  • Karma: +99/-1
    • View Profile
Re: How to specify wlink as linker for gcc?
« Reply #5 on: May 30, 2014, 04:44:37 pm »
Most everything needed can be installed with yum/rpm and has the advantage of being a standard environment. One problem with GCC and home spun environments is sometimes no one else can repeat what you did.

R.M. Klippstein

  • Sr. Member
  • ****
  • Posts: 313
  • Karma: +3/-0
    • View Profile
Re: How to specify wlink as linker for gcc?
« Reply #6 on: May 30, 2014, 06:51:09 pm »
Thanks Guys -- Looks Like YUM, for sure, is the way to go, I didn't realize GCC was available on YUM. I've got by the linker problem thanks to you, and now am in the build phase --YUK! Could you possibly straighten me out on another thing I don't completely understand? I'm familiar with SYMLINKS in Linux but not so smart when it comes to SYMLINKS in OS/2 -- I guess they are similar to shadows. My problem is I need to create a couple of Symlinks in the <libc trunk>. 
kmk_ln -s <libc trunk> /libc/include/os2d
kmk_ln -s <libc trunk>/kLdr src/VBox/Run

I don't understand, where & what,  is meant  by <klibc trunk>!  Would these need to be in the enviorment,  GCC (gccenv, or SET statement in config.sys?). I don't understand what to specify as <klibc trunk!>?
Thanks for the help & sorry to keep bothering you.   klipp

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4788
  • Karma: +99/-1
    • View Profile
Re: How to specify wlink as linker for gcc?
« Reply #7 on: May 31, 2014, 04:04:30 am »
Usually symlinks are implemented at the file system level which on OS/2 limits you to TVFS. klibc does it differently, supporting symlinks at the libc level so created symlinks only work with applications linked to libc. You can build coreutils or easier install with yum and get a working ln.exe, but only for symlinks and only in the libc environment.
The usual way of handling symlinks is to just copy, LN_S=cp -f.
Libc trunk is the main libc directory if you check out libc07 with svn I believe,
Code: [Select]
svn co http://svn.netlabs.org/repos/libc/trunkSee http://trac.netlabs.org/libc
ps symlinks and permissions are kept in EAs and if using HPFS are actually compatible with Linux so a symlink created under OS/2 on HPFS will work on Linux and vice versa.