Index: devel/libfirm/Makefile
===================================================================
RCS file: /cvs/ports/devel/libfirm/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- devel/libfirm/Makefile 6 Nov 2017 01:19:16 -0000 1.1.1.1
+++ devel/libfirm/Makefile 30 May 2018 02:35:07 -0000
@@ -5,15 +5,15 @@ ONLY_FOR_ARCHS = amd64 arm i386
# Must keep version number in sync with lang/cparser
COMMENT = graph based intermediate representation and backend
-DISTNAME = libfirm-1.22.1
+DISTNAME = ${GH_PROJECT}-1.22.1pl1
CATEGORIES = devel
-SHARED_LIBS += firm 0.0 # 0.0
+SHARED_LIBS += firm 1.0 # 1.0
-# amd64 PIC *just* missed 1.22.0; this will go away next update
+# Upstream doesn't make real tarballs. Expects you to use tags/commits.
GH_ACCOUNT = libfirm
GH_PROJECT = libfirm
-GH_COMMIT = 130099bc8afbca472500e378d927e1251d68bc18
+GH_COMMIT = e7a96ec68c8fb9637f067f14e47e0b5f90a0386b
HOMEPAGE = https://pp.ipd.kit.edu/firm/
MAINTAINER = Brian Callahan <bcallah@openbsd.org>
@@ -23,18 +23,18 @@ PERMIT_PACKAGE_CDROM = Yes
WANTLIB += m
-# Uncomment next update
-# MASTER_SITES = https://github.com/libfirm/libfirm/archive/
-
-MODULES = devel/cmake \
- lang/python
+MODULES = lang/python
MODPY_RUNDEP = No
+MODPY_ADJ_FILES = scripts/gen_ir.py
-CONFIGURE_ARGS = -DBUILD_SHARED_LIBS:Bool=On
+CONFIGURE_STYLE = none
-NO_TEST = Yes
+USE_GMAKE = Yes
+MAKE_FLAGS = DLLEXT=".so.${LIBfirm_VERSION}" \
+ REVISION="${GH_COMMIT}" V=1 variant=optimize
-# GitHub has silly naming practices. Uncomment next update.
-# WRKDIST = ${WRKDIR}/libfirm-${DISTNAME}
+FAKE_FLAGS = DESTDIR=
+
+NO_TEST = Yes
.include <bsd.port.mk>
Index: devel/libfirm/distinfo
===================================================================
RCS file: /cvs/ports/devel/libfirm/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- devel/libfirm/distinfo 6 Nov 2017 01:19:16 -0000 1.1.1.1
+++ devel/libfirm/distinfo 30 May 2018 02:35:07 -0000
@@ -1,2 +1,2 @@
-SHA256 (libfirm-1.22.1-130099bc.tar.gz) = XNrCsy8Q+6qfmHIgN0P4hnBOWewC7dsV6xtEYe7HHC4=
-SIZE (libfirm-1.22.1-130099bc.tar.gz) = 1581581
+SHA256 (libfirm-1.22.1pl1-e7a96ec6.tar.gz) = L+A8FF0p/uOGVaWo6dmKQ0WCOhLbsBr+Vd+xa/rGy88=
+SIZE (libfirm-1.22.1pl1-e7a96ec6.tar.gz) = 1613674
Index: devel/libfirm/patches/patch-CMakeLists_txt
===================================================================
RCS file: devel/libfirm/patches/patch-CMakeLists_txt
diff -N devel/libfirm/patches/patch-CMakeLists_txt
--- devel/libfirm/patches/patch-CMakeLists_txt 6 Nov 2017 01:19:16 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-CMakeLists_txt,v 1.1.1.1 2017/11/06 01:19:16 bcallah Exp $
-
-Let CMake do the SHARED_LIBS magic.
-
-Index: CMakeLists.txt
---- CMakeLists.txt.orig
-+++ CMakeLists.txt
-@@ -10,8 +10,6 @@ project(libfirm C)
- set(libfirm_VERSION "1.22.1")
- set(PROJECT_DESCRIPTION "library implementing the intermediate representation Firm")
-
--set(CMAKE_C_VISIBILITY_PRESET hidden)
--
- set(SOURCES
- ir/adt/array.c
- ir/adt/bipartite.c
Index: devel/libfirm/patches/patch-Makefile
===================================================================
RCS file: devel/libfirm/patches/patch-Makefile
diff -N devel/libfirm/patches/patch-Makefile
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ devel/libfirm/patches/patch-Makefile 30 May 2018 02:35:07 -0000
@@ -0,0 +1,23 @@
+$OpenBSD$
+
+Index: Makefile
+--- Makefile.orig
++++ Makefile
+@@ -38,7 +38,7 @@ endif
+ CFLAGS_debug = -O0 -g3
+ CFLAGS_profile = -O3 -pg -fno-inline -DNDEBUG
+ CFLAGS_coverage = -O0 --coverage
+-CFLAGS_optimize = -O3 -fomit-frame-pointer -DNDEBUG
++CFLAGS_optimize = -fomit-frame-pointer -DNDEBUG
+ LINKFLAGS_debug =
+ LINKFLAGS_profile = -pg
+ LINKFLAGS_coverage = --coverage
+@@ -156,7 +156,7 @@ $(libfirm_dll): $(libfirm_OBJECTS)
+ # Determine if we can use cparser-beta for quickcheck
+ QUICKCHECK_DEFAULT := $(shell which cparser-beta 2> /dev/null || echo true) -fsyntax-only
+ QUICKCHECK ?= $(QUICKCHECK_DEFAULT)
+-QUICKCHECK_FLAGS ?= -m32 -Wno-compat-option -Wno-shadow -Wno-shadow-local -Wunreachable-code
++QUICKCHECK_FLAGS ?= -Wno-compat-option -Wno-shadow -Wno-shadow-local -Wunreachable-code
+
+ $(builddir)/%.o: %.c $(IR_SPEC_GENERATED_INCLUDES)
+ @echo CC $@
Index: devel/libfirm/patches/patch-ir_be_platform_c
===================================================================
RCS file: devel/libfirm/patches/patch-ir_be_platform_c
diff -N devel/libfirm/patches/patch-ir_be_platform_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ devel/libfirm/patches/patch-ir_be_platform_c 30 May 2018 02:35:07 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+cparser/libFirm doesn't understand __only_inline.
+This lets us work around it.
+
+Index: ir/be/platform.c
+--- ir/be/platform.c.orig
++++ ir/be/platform.c
+@@ -171,6 +171,7 @@ void ir_platform_set(ir_machine_triple_t const *machin
+ goto BSD;
+ } else if (strstart(os, "openbsd")) {
+ ppdef1("__OpenBSD__");
++ ppdef("_ANSI_LIBRARY", ""); /* avoid __only_inline */
+ goto BSD;
+ } else if (strstr(os, "bsd") != NULL) {
+ BSD:
Index: devel/libfirm/pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/libfirm/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- devel/libfirm/pkg/PLIST 20 Jan 2018 09:13:35 -0000 1.2
+++ devel/libfirm/pkg/PLIST 30 May 2018 02:35:07 -0000
@@ -11,8 +11,6 @@ include/libfirm/adt/hungarian.h
include/libfirm/adt/list.h
include/libfirm/adt/obst.h
include/libfirm/adt/obstack.h
-include/libfirm/adt/pdeq.h
-include/libfirm/adt/plist.h
include/libfirm/adt/pmap.h
include/libfirm/adt/pqueue.h
include/libfirm/adt/pset.h
@@ -33,7 +31,6 @@ include/libfirm/firm_common.h
include/libfirm/firm_types.h
include/libfirm/heights.h
include/libfirm/ident.h
-include/libfirm/irarch.h
include/libfirm/ircgopt.h
include/libfirm/ircons.h
include/libfirm/irconsconfirm.h
@@ -58,18 +55,14 @@ include/libfirm/irouts.h
include/libfirm/irprintf.h
include/libfirm/irprog.h
include/libfirm/irverify.h
+include/libfirm/jit.h
include/libfirm/lowering.h
include/libfirm/nodes.h
include/libfirm/statev.h
+include/libfirm/target.h
include/libfirm/timing.h
include/libfirm/tv.h
include/libfirm/typerep.h
include/libfirm/vrp.h
-lib/cmake/
-lib/cmake/libfirm/
-lib/cmake/libfirm/libfirmConfig.cmake
-lib/cmake/libfirm/libfirmConfigVersion.cmake
-lib/cmake/libfirm/libfirmTargets${MODCMAKE_BUILD_SUFFIX}
-lib/cmake/libfirm/libfirmTargets.cmake
+lib/libfirm.a
@lib lib/libfirm.so.${LIBfirm_VERSION}
-lib/pkgconfig/libfirm.pc
Index: lang/cparser/Makefile
===================================================================
RCS file: /cvs/ports/lang/cparser/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- lang/cparser/Makefile 6 Nov 2017 01:21:07 -0000 1.1.1.1
+++ lang/cparser/Makefile 30 May 2018 02:35:07 -0000
@@ -5,13 +5,13 @@ ONLY_FOR_ARCHS = amd64 arm i386
# Must keep version number in sync with devel/libfirm
COMMENT = C99 parser and frontend for libFirm
-DISTNAME = cparser-1.22.1
+DISTNAME = ${GH_PROJECT}-1.22.1pl1
CATEGORIES = lang
-# amd64 PIC *just* missed 1.22.0; this goes away next update
+# Upstream expects you to use tags.
GH_ACCOUNT = libfirm
GH_PROJECT = cparser
-GH_COMMIT = 1930dff97172e8199c0d6f452f59dee47569d594
+GH_COMMIT = e5c27eb35709eba7cf7032005e12042cf0d1e3bf
HOMEPAGE = https://pp.ipd.kit.edu/firm/
MAINTAINER = Brian Callahan <bcallah@openbsd.org>
@@ -19,18 +19,16 @@ MAINTAINER = Brian Callahan <bcallah@ope
# GPLv2+
PERMIT_PACKAGE_CDROM = Yes
-WANTLIB += c firm m
+WANTLIB += c firm
-# Uncomment next update
-# MASTER_SITES = https://github.com/libfirm/cparser/archive/
+LIB_DEPENDS = devel/libfirm
-MODULES = devel/cmake
+USE_GMAKE = Yes
+MAKE_FLAGS = FIRM_LIBS="-L${LOCALBASE}/lib -lfirm" \
+ REVISION="${GH_COMMIT}" V=1 variant=optimize
-LIB_DEPENDS = devel/libfirm
+FAKE_FLAGS = DESTDIR= MANDIR="${DESTDIR}${PREFIX}/man"
NO_TEST = Yes
-
-# GitHub has silly naming practices. Uncomment next update.
-# WRKDIST = ${WRKDIR}/cparser-${DISTNAME}
.include <bsd.port.mk>
Index: lang/cparser/distinfo
===================================================================
RCS file: /cvs/ports/lang/cparser/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- lang/cparser/distinfo 6 Nov 2017 01:21:07 -0000 1.1.1.1
+++ lang/cparser/distinfo 30 May 2018 02:35:07 -0000
@@ -1,2 +1,2 @@
-SHA256 (cparser-1.22.1-1930dff9.tar.gz) = Q4Qul3xeLp96daMOxjoUeGRqacclBNJBlMn1SDmOTKI=
-SIZE (cparser-1.22.1-1930dff9.tar.gz) = 289387
+SHA256 (cparser-1.22.1pl1-e5c27eb3.tar.gz) = TVMVGHS4P+RvvvpTA+3TfVCtUZFj7IR7+TdB8lx893s=
+SIZE (cparser-1.22.1pl1-e5c27eb3.tar.gz) = 291517
Index: lang/cparser/patches/patch-CMakeLists_txt
===================================================================
RCS file: lang/cparser/patches/patch-CMakeLists_txt
diff -N lang/cparser/patches/patch-CMakeLists_txt
--- lang/cparser/patches/patch-CMakeLists_txt 6 Nov 2017 01:21:07 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-CMakeLists_txt,v 1.1.1.1 2017/11/06 01:21:07 bcallah Exp $
-
-Install manual page correctly.
-
-Index: CMakeLists.txt
---- CMakeLists.txt.orig
-+++ CMakeLists.txt
-@@ -118,5 +118,5 @@ set(INSTALL_HEADERS
- include/stddef.h
- )
- install(FILES ${INSTALL_HEADERS} DESTINATION ${COMPILER_INCLUDE_DIR})
--install(FILES cparser.1 DESTINATION share/man/man1)
-+install(FILES cparser.1 DESTINATION man/man1)
- install(TARGETS cparser DESTINATION bin)
Index: lang/cparser/patches/patch-Makefile
===================================================================
RCS file: lang/cparser/patches/patch-Makefile
diff -N lang/cparser/patches/patch-Makefile
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lang/cparser/patches/patch-Makefile 30 May 2018 02:35:07 -0000
@@ -0,0 +1,23 @@
+$OpenBSD$
+
+Index: Makefile
+--- Makefile.orig
++++ Makefile
+@@ -34,7 +34,7 @@ endif
+
+ CPPFLAGS := $(CPPFLAGS) $(FIRM_CPPFLAGS)
+
+-CFLAGS += -Wall -W -Wstrict-prototypes -Wmissing-prototypes
++CFLAGS += -Wall -W -Wstrict-prototypes -Wmissing-prototypes -I${LOCALBASE}/include
+ # With -std=c99 we get __STRICT_ANSI__ which disables all posix declarations
+ # in cygwin, regardless of a set POSIX_C_SOURCE feature test macro.
+ ifneq ($(filter %cygwin %mingw32, $(shell $(CC) $(CFLAGS) -dumpmachine)),)
+@@ -43,7 +43,7 @@ else
+ CFLAGS += -std=c99 -pedantic
+ endif
+ CFLAGS_debug = -O0 -g
+-CFLAGS_optimize = -O3 -fomit-frame-pointer -DNDEBUG -DNO_DEFAULT_VERIFY
++CFLAGS_optimize = -fomit-frame-pointer -DNDEBUG -DNO_DEFAULT_VERIFY
+ CFLAGS_profile = -pg -O3 -fno-inline
+ CFLAGS_coverage = --coverage -O0
+ CFLAGS += $(CFLAGS_$(variant))
Index: lang/cparser/patches/patch-src_driver_predefs_c
===================================================================
RCS file: lang/cparser/patches/patch-src_driver_predefs_c
diff -N lang/cparser/patches/patch-src_driver_predefs_c
--- lang/cparser/patches/patch-src_driver_predefs_c 6 Nov 2017 01:21:07 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-$OpenBSD: patch-src_driver_predefs_c,v 1.1.1.1 2017/11/06 01:21:07 bcallah Exp $
-
-cparser doesn't understand __attribute__((__gnu_inline__)).
-This causes all sorts of multiple definition linker errors.
-So let's set the GCC compatibility to too old for it.
-
-Also doesn't understand _Pragma.
-Let's say we're GCC 3.4.6 (for now) because of all this.
-
-Index: src/driver/predefs.c
---- src/driver/predefs.c.orig
-+++ src/driver/predefs.c
-@@ -245,9 +245,9 @@ void add_predefined_macros(void)
- add_define("__CPARSER_PATCHLEVEL__", CPARSER_PATCHLEVEL, false);
-
- /* let's pretend we are a GCC compiler */
-- add_define("__GNUC__", "4", false);
-- add_define("__GNUC_MINOR__", "6", false);
-- add_define("__GNUC_PATCHLEVEL__", "0", false);
-+ add_define("__GNUC__", "3", false);
-+ add_define("__GNUC_MINOR__", "4", false);
-+ add_define("__GNUC_PATCHLEVEL__", "6", false);
- if (dialect.cpp)
- add_define("__GNUG__", "4", false);
-
Index: lang/cparser/patches/patch-src_driver_target_c
===================================================================
RCS file: /cvs/ports/lang/cparser/patches/patch-src_driver_target_c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-src_driver_target_c
--- lang/cparser/patches/patch-src_driver_target_c 6 Nov 2017 01:21:07 -0000 1.1.1.1
+++ lang/cparser/patches/patch-src_driver_target_c 30 May 2018 02:35:07 -0000
@@ -5,23 +5,15 @@ Add OpenBSD and set it up properly.
Index: src/driver/target.c
--- src/driver/target.c.orig
+++ src/driver/target.c
-@@ -288,6 +288,10 @@ static void set_options_for_machine(machine_triple_t c
- } else if (strstr(os, "bsd") != NULL) {
- init_generic_elf();
- init_unix();
-+#if defined(__OpenBSD__)
-+ target.pic_mode = 1;
-+ ppdef( "__OpenBSD__", "1");
-+#endif
- } else if (streq(os, "elf") || streq(os, "octopos") || streq(os, "irtss")) {
- init_generic_elf();
- } else if (strstart(os, "darwin")) {
-@@ -514,6 +518,8 @@ static machine_triple_t *get_host_machine_triple(void)
- machine->operating_system = xstrdup("linux-gnu");
- #elif defined(__linux__)
- machine->operating_system = xstrdup("linux");
-+#elif defined(__OpenBSD__)
-+ machine->operating_system = xstrdup("bsd");
- #elif defined(__midipix__)
- machine->operating_system = xstrdup("midipix");
- #elif defined(__ELF__)
+@@ -245,6 +245,11 @@ void init_firm_target(void)
+ errorf(NULL, "Failed to initialize libfirm code generation\n");
+ exit(EXIT_FAILURE);
+ }
++
++ if (strstart(ir_triple_get_operating_system(target.machine), "openbsd")) {
++ target.pic = true;
++ target.set_pic = true;
++ }
+ }
+
+ bool target_setup(void)
Index: lang/cparser/patches/patch-src_driver_warning_h
===================================================================
RCS file: /cvs/ports/lang/cparser/patches/patch-src_driver_warning_h,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-src_driver_warning_h
--- lang/cparser/patches/patch-src_driver_warning_h 6 Nov 2017 01:21:07 -0000 1.1.1.1
+++ lang/cparser/patches/patch-src_driver_warning_h 30 May 2018 02:35:07 -0000
@@ -7,7 +7,7 @@ We don't need a -Wexperimental warning f
Index: src/driver/warning.h
--- src/driver/warning.h.orig
+++ src/driver/warning.h
-@@ -34,7 +34,7 @@ void print_warning_opt_help(void);
+@@ -36,7 +36,7 @@ void print_warning_opt_help(void);
M(WARN_ENDIF_LABELS, ON, "endif-labels", "Warn whenever an '#else' or an '#endif' are followed by text") \
M(WARN_ENUM_CONVERSION, ON, "enum-conversion", "warn about implicit conversion between different enum types") \
M(WARN_ERROR, OFF, "error", "Treat warnings as errors") \
On 05/23/18 23:15, Brian Callahan wrote:
> Hi ports --
>
> I'd like to push a pl1 to libfirm and cparser. I got upstream to commit patches to recognize OpenBSD as a platform and there are some nice improvements to the compiler (notably, cparser can now rebuild libfirm and itself, at least on amd64).
>
> I'd also like to switch from cmake to gmake, since upstream really only supports gmake (and the cmake stuff is currently broken).
>
> Is anyone else using this besides me? i386 tests would be very appreciated.
>
> OK?
>
> ~Brian
>
Ping. In the meantime, there was some extra commits made, so new diff.
~Brian
No comments:
Post a Comment