DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 3rd September 2017
gpatrick gpatrick is offline
Spam Deminer
 
Join Date: Nov 2009
Posts: 245
Default Compiling Vishap Oberon

I'm running OpenBSD 6.2 i386 snapshot on my Thinkpad T60 and am trying to compiling Vishap Oberon which is supported on OpenBSD. However, I'm getting an error during 'make full' which is in the attachment.

The last 3 lines are
Code:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
g && clang -fPIC -g -static Compiler.c -o /tmp/voc/voc ...)
*** Error 1 in . (src/tools/make/oberon.mk:86 'compilerfromsavedsource')
*** Error 1 in /tmp/voc (makefile:140 'full')
Attached Files
File Type: txt typescript.txt (14.4 KB, 52 views)
Reply With Quote
  #2   (View Single Post)  
Old 3rd September 2017
gpatrick gpatrick is offline
Spam Deminer
 
Join Date: Nov 2009
Posts: 245
Default

Update:

I was able to build Vishap Oberon successfully from source
Code:
https://github.com/vishaps/voc.git
using OpenBSD amd64 and also on FreeBSD amd64. The failure is in i386 even though it states it as a supported architecture.

Last edited by gpatrick; 3rd September 2017 at 09:26 PM.
Reply With Quote
  #3   (View Single Post)  
Old 4th September 2017
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

Change line 22 in bootstrap/SYSTEM.h and src/runtime/SYSTEM.h from:
Code:
  typedef unsigned int         size_t;
to
Code:
  typedef unsigned long        size_t;

Last edited by ibara; 4th September 2017 at 03:00 AM. Reason: Better.
Reply With Quote
  #4   (View Single Post)  
Old 4th September 2017
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

Also fyi those last 3 lines you posted don't help at all. But the log did help.
Reply With Quote
  #5   (View Single Post)  
Old 4th September 2017
gpatrick gpatrick is offline
Spam Deminer
 
Join Date: Nov 2009
Posts: 245
Default

That worked. Thank you.

Do you mind if I ask how you was able to determine that from the output? I saw many references to SYSTEM.h, but they didn't have line 22, or the directories so clearly defined.
Reply With Quote
  #6   (View Single Post)  
Old 5th September 2017
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

Line 22 just happens to be the line in both SYSTEM.h files. It's not relevant to anything else.

size_t is an unsigned long in OpenBSD (size_t is typedef'd in sys/types.h as a __size_t; __size_t is typedef'd in sys/_types.h as an unsigned long, so therefore size_t is an unsigned long). Because voc uses no system includes at all, it has to typedef size_t itself (otherwise, size_t means nothing) which it does using that block of preprocessor #ifdef's. It so happens to be wrong for OpenBSD when it's a 32-bit architecture (as size_t is then typedef'd as an unsigned int). It happens to be correct on 64-bit architectures, which is why it built on amd64 just fine.

Next, the compiler sees a prototype for the functions memcpy and alloca. Modern C compilers tend to be very smart and know the prototypes of a whole host of standard libc functions without any external aid. But wait--the prototype that clang knows doesn't match the prototype voc is giving it (specifically, the final parameter of each according to clang is an unsigned long but according to voc is an unsigned int). clang takes this to mean that you are overriding the libc function with those names. There is never a function provided by voc named memcpy or alloca, since voc really wants the libc functions. Now, when clang tries to link things, it discards the libc memcpy and alloca functions as possible candidates for your memcpy and alloca functions. And therefore there are no functions with those names and you get the classic undefined reference error from the linker.

You should probably report this to upstream.
Reply With Quote
  #7   (View Single Post)  
Old 5th September 2017
gpatrick gpatrick is offline
Spam Deminer
 
Join Date: Nov 2009
Posts: 245
Default

Thanks again. I opened a new issue so the maintainers can fix it.
Reply With Quote
  #8   (View Single Post)  
Old 6th September 2017
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

Looks like we got the fix in.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling qt5-qbase58 darktrym NetBSD Package System (pkgsrc) 2 3rd August 2017 09:31 PM
compiling NextStep WM? philo_neo71 OpenBSD Packages and Ports 7 3rd October 2016 10:57 PM
Compiling e17 from source divadgnol67 OpenBSD Packages and Ports 3 2nd January 2011 02:57 PM
c++ compiling hello world Gates Programming 3 26th July 2008 12:48 PM
Compiling Nagios 3.02 roundkat Solaris 1 2nd June 2008 09:09 PM


All times are GMT. The time now is 04:09 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick