Mercury Bugs - mercury
View Issue Details
0000262mercuryBugpublic2012-08-27 08:422013-05-22 13:42
Reportervezhlys 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
Platformamd64OSNetBSDOS Version6_RC1
Product Version 
Target VersionFixed in Version 
Summary0000262: Mercury doesn't compile on NetBSD
DescriptionMercury programming language doesn't compile in NetBSD operating system. I tried to compile it using from NetBSD source package management (pkgsrc). It ended up with error:

os_dep.c:503:9: error: redefinition of 'GC_data_start'
os_dep.c:454:9: note: previous definition of 'GC_data_start' was here
gmake[3]: *** [os_dep.o] Error 1
gmake[3]: Leaving directory `/usr/pkgsrc/lang/mercury/work/mercury-compiler-11.07/boehm_gc'
gmake[2]: *** [submake] Error 2
gmake[2]: Leaving directory `/usr/pkgsrc/lang/mercury/work/mercury-compiler-11.07/boehm_gc'
gmake[1]: *** [boehm_gc] Error 2
gmake[1]: Leaving directory `/usr/pkgsrc/lang/mercury/work/mercury-compiler-11.07'
gmake: *** [install] Error 2
*** Error code 2

Stop.
make: stopped in /usr/pkgsrc/lang/mercury
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/lang/mercury

It seems that solution is simple. I commented two duplicate definitions GC_data_start and GC_find_limit as they were defined exactly the same a bit earlier in the same file (see lines 454-456). Mercury compiled fine then. I looked into current version of os_dep.c file and it is the same (pkgsrc retrieves mercury-compiler-11.07.tar.gz currently) because of this it should fail too.
Steps To ReproduceCompile mercury on netbsd.
Additional Information--- os_dep.c 2012-08-27 01:08:21.000000000 +0300
+++ os_dep.c 2012-08-27 01:09:19.000000000 +0300
@@ -500,8 +500,8 @@
 # endif /* ECOS */
 
 #if defined(NETBSD) && defined(__ELF__)
- ptr_t GC_data_start = NULL;
- ptr_t GC_find_limit(ptr_t, GC_bool);
+ //ptr_t GC_data_start = NULL;
+ //ptr_t GC_find_limit(ptr_t, GC_bool);
 
   extern char **environ;
TagsNo tags attached.
Attached Files

Notes
(0000526)
juliensf   
2013-05-22 13:42   
I've tried the source distribution for the latest stable release (13.05) on NetBSD 6.1 (i386) and it
appears to be fine. I'll do some further testing since I also have a patch that enables support for shared libraries on that platform.

If there are problems with the version in pkgsrc then they are best taken up with the maintainer of that package. (The version of the Boehm GC that is shipped with Mercury has been bumped several times since the 11.07 release; my best guess is that the newer versions probably fix the problems encountered above.)

Issue History
2012-08-27 08:42vezhlysNew Issue
2013-05-22 13:42juliensfNote Added: 0000526