Author Topic: Compiling PMMail with GCC 4.9.2  (Read 768 times)

Neil Waldhauer

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 27
  • Posts: 423
    • View Profile
    • Blonde Guy
Compiling PMMail with GCC 4.9.2
« on: June 03, 2019, 07:42:03 pm »
I'd like to compile PMMail using GCC 4.9.2. Currently I have GCC 3.3.5 and a bunch of tools working.

I had hoped to just drop in GCC 4.9.2 in place of GCC 4.9.2, but somehow my GCC 4.9.2 setup is wrong.

It compiles PMMail just fine until it hits a va_start() macro. I have the same trouble compiling the attached vatest.c

In file included from k:/programs/gcc/include/machine/stdarg.h:2:0,
                 from k:/programs/gcc/include/stdarg.h:2,
                 from vatest.c:1:
vatest.c: In function 'int sum(int, ...)':
vatest.c:18:4: error: '__builtin_stdarg_start' was not declared in this scope
    va_start(ap, num_args);

Those don't look like the right include files to me. Something is wrong, but what?
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 10
  • -Receive: 139
  • Posts: 1987
    • View Profile
Re: Compiling PMMail with GCC 4.9.2
« Reply #1 on: June 03, 2019, 09:18:03 pm »
I can't find a reference anywhere to a header containing the __builtin_stdarg_start but attempting to compile here using GCC 4.9.2 results in
Code: [Select]
[Z:\Mozprofiles\Downloads]gcc -Zomf vatest.c

[Z:\Mozprofiles\Downloads]dir vatest*

The volume label in drive Z is mozprofiles.
The Volume Serial Number is E5C3:E5BD.
Directory of Z:\Mozprofiles\Downloads

 6-03-19 12:05p           453      0 a---  vatest.c
 6-03-19 12:13p         4,904      0 a---  vatest.exe
        2 file(s)       5,357 bytes used
                   20,105,801 K bytes free

[Z:\Mozprofiles\Downloads]vatest.exe
Sum of 10, 20 and 30 = 60
Sum of 4, 20, 25 and 30 = 79

Why aren't you installing GCC 4.9.2 with YUM/RPM or ANPM?

Gregg Young

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 5
  • Posts: 47
    • View Profile
Re: Compiling PMMail with GCC 4.9.2
« Reply #2 on: June 03, 2019, 11:37:30 pm »
Try reinstalling libc-0.1.1-1-devel which is where the header for this is located. The header is "include\386\stdarg.h". It defines va_start.

Neil Waldhauer

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 27
  • Posts: 423
    • View Profile
    • Blonde Guy
Re: Compiling PMMail with GCC 4.9.2
« Reply #3 on: June 04, 2019, 02:35:38 am »

Why aren't you installing GCC 4.9.2 with YUM/RPM or ANPM?

I tried installing gcc with yum/rpm. I can compile the example code with that gcc.

But I can't find the environment. How does that copy of gcc find its header files?

Neil
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 10
  • -Receive: 139
  • Posts: 1987
    • View Profile
Re: Compiling PMMail with GCC 4.9.2
« Reply #4 on: June 04, 2019, 05:07:48 am »
It's basically hard coded to look in @UNIXROOT/usr/include as well as @UNIXROOT/usr/lib/gcc/i386-pc-os2-emx/4.9.2/include and include-fixed. You can override with set C_INCLUDE_PATH and CPLUS_INCLUDE_PATH.

Neil Waldhauer

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 27
  • Posts: 423
    • View Profile
    • Blonde Guy
Re: Compiling PMMail with GCC 4.9.2
« Reply #5 on: June 05, 2019, 06:05:53 am »
OK, I combined gcc installed by rpm/yum with the rest of the PMMail build environment. It looks promising.

I can supply ilink.exe myself, but is there one in the rpm/yum universe?
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 10
  • -Receive: 139
  • Posts: 1987
    • View Profile
Re: Compiling PMMail with GCC 4.9.2
« Reply #6 on: June 05, 2019, 06:56:47 am »
Use wlink (wl.exe). Run emxomfld with no parameters to see the environment variables to set to use it. You may have to also use lxlite on the resulting binary as wlink doesn't pack the binary like ilink can do. Package is watcom-wlink-hll.
« Last Edit: June 05, 2019, 07:01:33 am by Dave Yeo »

Gregg Young

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 5
  • Posts: 47
    • View Profile
Re: Compiling PMMail with GCC 4.9.2
« Reply #7 on: July 08, 2019, 07:52:44 pm »
After building pmmail we discovered an odd issue with the gcc compilers. The popen function is hard coded to use sh as its shell which doesn't play well with path names containing back slashes and of course fails on systems where sh isn't installed.  This problem exists in 4.9.2 (I haven't tried the RPM version) and 8.3.0 (only ones I have tried). Apparently this wasn't true for 3.3.5. I have reported this on Paul's Mantis site.

Rich Walsh

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 6
  • Posts: 80
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: Compiling PMMail with GCC 4.9.2
« Reply #8 on: July 08, 2019, 11:02:07 pm »
After building pmmail we discovered an odd issue with the gcc compilers. The popen function is hard coded to use sh as its shell which doesn't play well with path names containing back slashes and of course fails on systems where sh isn't installed.

I ran into this and got annoyed enough to write my own which doesn't use any shell at all. See the attachment.

While we're on the subject of annoyances... The file's extension should be '.c' but os2world won't allow me to attach something so dangerous, so I had to change it to '.txt'.

Paul Smedley

  • Sr. Member
  • ****
  • Thank You
  • -Given: 11
  • -Receive: 53
  • Posts: 430
    • View Profile
Re: Compiling PMMail with GCC 4.9.2
« Reply #9 on: July 09, 2019, 01:58:52 am »
After building pmmail we discovered an odd issue with the gcc compilers. The popen function is hard coded to use sh as its shell which doesn't play well with path names containing back slashes and of course fails on systems where sh isn't installed.  This problem exists in 4.9.2 (I haven't tried the RPM version) and 8.3.0 (only ones I have tried). Apparently this wasn't true for 3.3.5. I have reported this on Paul's Mantis site.

umm popen is part of libc, not the compiler......

Gregg Young

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 5
  • Posts: 47
    • View Profile
Re: Compiling PMMail with GCC 4.9.2
« Reply #10 on: July 09, 2019, 02:08:33 am »
Rich Thanks for the code.

Paul Yes I realize that now sorry for the noise.