Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 304625 - dev-lang/smlnj-110.74 version bump
Summary: dev-lang/smlnj-110.74 version bump
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Team for the ML programming language family
URL: http://www.smlnj.org/dist/working/110...
Whiteboard:
Keywords:
: 438852 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-02-11 19:56 UTC by Richard
Modified: 2012-10-19 10:36 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
dev-lang/smlnj-110.72 ebuild (smlnj-110.72.ebuild,1.83 KB, text/plain)
2010-05-19 20:43 UTC, Richard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard 2010-02-11 19:56:42 UTC
SML/NJ 110.72 is out. It fixes a few bugs that would be nice to have fixed in Gentoo's version of it.

http://www.smlnj.org/dist/working/110.72/110.72-README.html
Comment 1 Paulo J. Matos 2010-02-20 23:51:56 UTC
Just renaming the file works so the actual transition for this shouldn't be too hard! :)
Comment 2 Richard 2010-05-19 20:43:49 UTC
Created attachment 232149 [details]
dev-lang/smlnj-110.72 ebuild

Renaming the ebuild and putting it in a local overlay appears to allow a system to be upgraded to SML 110.72.
Comment 3 Richard 2010-05-19 20:44:51 UTC
(In reply to comment #2)
> Created an attachment (id=232149) [details]
> dev-lang/smlnj-110.72 ebuild
> 
> Renaming the ebuild and putting it in a local overlay appears to allow a system
> to be upgraded to SML 110.72.
> 

In hindsight, this is exactly what Paulo J. Matos said. I just did not understand what he meant until recently when I discovered the primary mechanism for doing version bumps on Gentoo is by renaming ebuilds.
Comment 4 Michael Weber (RETIRED) gentoo-dev 2010-06-29 10:03:51 UTC
I just verified this,
Comment 5 Michael Weber (RETIRED) gentoo-dev 2010-06-29 11:21:01 UTC
i wanto to propose this patch to resolve bug 243886

--- smlnj-110.71.ebuild 2009-10-09 16:33:22.000000000 +0200
+++ smlnj-110.72.ebuild 2010-06-29 13:09:35.000000000 +0200
@@ -4,7 +4,7 @@
 
 EAPI=2
 
-inherit eutils
+inherit eutils toolchain-funcs
 
 DESCRIPTION="Standard ML of New Jersey compiler and libraries"
 HOMEPAGE="http://www.smlnj.org"
@@ -70,6 +70,15 @@
        echo SRCARCHIVEURL=\"file:/${S}\" > "${S}"/config/srcarchiveurl
 }
 
+src_prepare() {
+       # resolving bug 243886, unpack the runtime, change the CC et al.,
+       mkdir base || die
+       ./config/unpack "${S}" runtime || die
+       sed -i -e "/^AS/s:as:$(tc-getAS):" -e "/^CC/s:gcc:$(tc-getCC):" \
+               -e "/CPP/s:gcc:$(tc-getCC):" -e "/^CFLAGS/{s:-O[0123s]:: ; s:=:= ${CFLAGS}:}" \
+               base/runtime/objs/mk.x86-linux || die
+}
+
 src_compile() {
        SMLNJ_HOME="${S}" ./config/install.sh || die "compilation failed"
 }

It switches base/runtime/objs/mk.x86-linux from

# mk.x86-linux
#

SHELL =		/bin/sh

MAKE =		make
AS =		as --32
CC =		gcc -ansi
CFLAGS =	-O2 -m32
CPP =		gcc -x assembler-with-cpp -E -P
#XOBJS =	xmonitor.o
#LD_LIBS =	-lX11
#BASE_DEFS =	-DHEAP_MONITOR
XOBJS =
XLIBS =		../c-libs/dl/libunix-dynload.a
LD_LIBS =	-ldl
XDEFS =
BASE_DEFS =
DEFS		= $(XDEFS) $(BASE_DEFS) -DHOST_X86 -DTARGET_X86 -DOPSYS_UNIX -DOPSYS_LINUX -D_GNU_SOURCE -DGNU_ASSEMBLER -DDLOPEN
TARGET =	X86
VERSION =	v-x86-linux
RUNTIME =	run.x86-linux
RUNTIME_SO =	run.x86-linux.so
RUNTIME_A =	run.x86-linux.a

all:
	($(MAKE) RUNTIME="$(RUNTIME)" VERSION="$(VERSION)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" $(RUNTIME))
	($(MAKE) RUNTIME="$(RUNTIME_SO)" VERSION="$(VERSION)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="-shared" $(RUNTIME_SO))
	($(MAKE) RUNTIME_A="$(RUNTIME_A)" VERSION="$(VERSION)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="" $(RUNTIME_A))

to 

# mk.x86-linux
#

SHELL =		/bin/sh

MAKE =		make
AS =		x86_64-pc-linux-gnu-as --32
CC =		x86_64-pc-linux-gnu-gcc -ansi
CFLAGS = -march=core2 -mtune=core2 -mfpmath=sse -mieee-fp -O2 -pipe	 -m32
CPP =		x86_64-pc-linux-gnu-gcc -x assembler-with-cpp -E -P
#XOBJS =	xmonitor.o
#LD_LIBS =	-lX11
#BASE_DEFS =	-DHEAP_MONITOR
XOBJS =
XLIBS =		../c-libs/dl/libunix-dynload.a
LD_LIBS =	-ldl
XDEFS =
BASE_DEFS =
DEFS		= $(XDEFS) $(BASE_DEFS) -DHOST_X86 -DTARGET_X86 -DOPSYS_UNIX -DOPSYS_LINUX -D_GNU_SOURCE -DGNU_ASSEMBLER -DDLOPEN
TARGET =	X86
VERSION =	v-x86-linux
RUNTIME =	run.x86-linux
RUNTIME_SO =	run.x86-linux.so
RUNTIME_A =	run.x86-linux.a

all:
	($(MAKE) RUNTIME="$(RUNTIME)" VERSION="$(VERSION)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" $(RUNTIME))
	($(MAKE) RUNTIME="$(RUNTIME_SO)" VERSION="$(VERSION)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="-shared" $(RUNTIME_SO))
	($(MAKE) RUNTIME_A="$(RUNTIME_A)" VERSION="$(VERSION)" AS="$(AS)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CPP)" TARGET=$(TARGET) DEFS="$(DEFS)" XOBJS="$(XOBJS)" XLIBS="$(XLIBS)" LD_LIBS="$(LD_LIBS)" LDFLAGS="" $(RUNTIME_A))
Comment 6 Richard 2010-06-30 03:56:48 UTC
Will the new ebuild also resolve bug #318737?
Comment 7 Marijn Schouten (RETIRED) gentoo-dev 2011-10-19 14:41:42 UTC
The same ebuild still works for 110.73, but there are multiple issues for which someone should send a comment or patch upstream. Specifically:

 * QA Notice: The following files contain runtime text relocations
 *  Text relocations force the dynamic linker to perform extra
 *  work at startup, waste system resources, and may pose a security
 *  risk.  On some architectures, the code may not even function
 *  properly, if at all.
 *  For more information, see http://hardened.gentoo.org/pic-fix-guide.xml
 *  Please include the following list of files in your report:
 * TEXTREL usr/bin/.run/run.x86-linux.so

not sure if this is something that needs acting upon.

 * QA Notice: The following files contain writable and executable sections
 *  Files with such sections will not work properly (or at all!) on some
 *  architectures/operating systems.  A bug should be filed at
 *  http://bugs.gentoo.org/ to make sure the issue is fixed.
 *  For more information, see http://hardened.gentoo.org/gnu-stack.xml
 *  Please include the following list of files in your report:
 *  Note: Bugs should be filed for the respective maintainers
 *  of the package in question and not hardened@g.o.
 * !WX --- --- usr/bin/.run/run.x86-linux.a:prim.o
 * RWX --- --- usr/bin/.run/run.x86-linux.so
 * RWX --- --- usr/bin/.run/run.x86-linux

We need proper stack markings.

 * QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * mktime.c:24:5: warning: incompatible implicit declaration of built-in function 'memset'
 * heap-out-util.c:55:14: warning: incompatible implicit declaration of built-in function 'strlen'
 * mem-writer.c:82:5: warning: incompatible implicit declaration of built-in function 'memcpy'
 * c-globals-tbl.c:81:2: warning: incompatible implicit declaration of built-in function 'memset'
 * c-globals-tbl.c:350:13: warning: incompatible implicit declaration of built-in function 'strlen'
 * c-globals-tbl.c:368:5: warning: incompatible implicit declaration of built-in function 'memset'

This means these files didn't include the header file in which the called functions are declared.

In addition, the problem identified with the Makefile by Mark Weber in comment 5 could hopefully be resolved upstream.

I don't have time to do these myself.

I am unwilling to bump with all these issues present.
Comment 8 Michael Weber (RETIRED) gentoo-dev 2012-04-17 14:30:28 UTC
new version released [1/31/12]
Comment 9 Marijn Schouten (RETIRED) gentoo-dev 2012-10-19 07:32:29 UTC
*** Bug 438852 has been marked as a duplicate of this bug. ***
Comment 10 Marijn Schouten (RETIRED) gentoo-dev 2012-10-19 10:36:23 UTC
Time fixed some of the QA issues and I've committed an ebuild for 110.75.

Further I've looked again at open bugs for smlnj for which Michael Weber (xmw) has so kindly provided patches. It is my opinion that the ebuild workarounds are too fragile and that instead most of these issues need to be fixed upstream.