On Fri, Nov 03, 2017 at 08:59:51PM -0400, Brian Callahan wrote: > Hi Mike -- > > On 11/3/2017 7:14 PM, Mike Larkin wrote: > > On Fri, Nov 03, 2017 at 11:25:46AM -0400, Brian Callahan wrote: > >> Hi ports -- > >> > >> The attached works for me to re-enable lang/freebasic on i386. Can anyone > >> else give this a spin? > >> > >> ~Brian > >> > > I think you already committed this, but to close the loop, I tested this on > > an i386 vmm(4) VM and it works fine. It needs some machinations around paths > > to find -lgcc and cc1 but if you do all that it seems to do what is > > expected. > > Thanks for this. Are you using lld for the linker? I tried to get the > machinations to just work(TM) and thought I caught them all but happy to > test out things to make it better, of course. > > ~Brian >
It built fine, but then complained at run about not being able to find cc1. I added that to $PATH manually, and then it complained about not being able to find -lgcc. I fixed that by copying it to the same directory as I was running from. Then it worked. (Tried LDFLAGS with -L/path/to/libgcc but that didn't work). I just built a lame 2 line basic program, but after doing those things above, it did work. -ml > > -ml > > > > > >> Index: Makefile > >> =================================================================== > >> RCS file: /cvs/ports/lang/freebasic/Makefile,v > >> retrieving revision 1.2 > >> diff -u -p -u -p -r1.2 Makefile > >> --- Makefile 27 Oct 2017 20:41:47 -0000 1.2 > >> +++ Makefile 28 Oct 2017 23:52:28 -0000 > >> @@ -1,8 +1,6 @@ > >> # $OpenBSD: Makefile,v 1.2 2017/10/27 20:41:47 bcallah Exp $ > >> > >> -BROKEN-i386 = bad bootstrap > >> - > >> -# All they seem to support. > >> +# May also support aarch64 and arm? > >> ONLY_FOR_ARCHS = amd64 i386 > >> > >> V = 1.05.0 > >> Index: patches/patch-makefile > >> =================================================================== > >> RCS file: /cvs/ports/lang/freebasic/patches/patch-makefile,v > >> retrieving revision 1.1.1.1 > >> diff -u -p -u -p -r1.1.1.1 patch-makefile > >> --- patches/patch-makefile 23 Oct 2017 21:46:58 -0000 1.1.1.1 > >> +++ patches/patch-makefile 28 Oct 2017 23:52:28 -0000 > >> @@ -6,7 +6,17 @@ Keep tendrils here to make generating fu > >> Index: makefile > >> --- makefile.orig > >> +++ makefile > >> -@@ -393,7 +393,8 @@ endif > >> +@@ -295,9 +295,7 @@ endif > >> + # ENABLE_PIC for non-x86 Linux etc. (for every system where we need > >> separate > >> + # -fPIC versions of FB libs besides the normal ones) > >> + ifneq ($(filter freebsd linux netbsd openbsd solaris,$(TARGET_OS)),) > >> +- ifneq ($(TARGET_ARCH),x86) > >> + ENABLE_PIC := YesPlease > >> +- endif > >> + endif > >> + > >> + ifneq ($(filter cygwin dos win32,$(TARGET_OS)),) > >> +@@ -393,7 +391,8 @@ endif > >> > >> ALLFBCFLAGS += -e -m fbc -w pedantic > >> ALLFBLFLAGS += -e -m fbc -w pedantic > >> @@ -16,7 +26,7 @@ Index: makefile > >> > >> ifeq ($(TARGET_OS),xbox) > >> ifeq ($(OPENXDK),) > >> -@@ -1050,32 +1051,16 @@ FBBOOTSTRAPTITLE := $(FBSOURCETITLE)-bootstrap > >> +@@ -1050,32 +1049,16 @@ FBBOOTSTRAPTITLE := $(FBSOURCETITLE)-bootstrap > >> bootstrap-dist: > >> # Precompile fbc sources for various targets > >> rm -rf bootstrap > >> @@ -55,7 +65,19 @@ Index: makefile > >> # > >> # Build the fbc[.exe] binary from the precompiled sources in the > >> bootstrap/ > >> # directory. > >> -@@ -1098,6 +1083,7 @@ else > >> +@@ -1086,22 +1069,16 @@ bootstrap: rtlib gfxlib2 $(BOOTSTRAP_FBC) > >> + mkdir -p bin > >> + cp $(BOOTSTRAP_FBC) $(FBC_EXE) > >> + > >> +-ifeq ($(TARGET_ARCH),x86) > >> +- # x86: .asm => .o (using the same assembler options as fbc) > >> +- BOOTSTRAP_OBJ = $(patsubst %.asm,%.o,$(sort $(wildcard > >> bootstrap/$(FBTARGET)/*.asm))) > >> +- $(BOOTSTRAP_OBJ): %.o: %.asm > >> +- $(QUIET_AS)$(AS) --strip-local-absolute $< -o $@ > >> +-else > >> + # x86_64 etc.: .c => .o (using the same gcc options as fbc -gen gcc) > >> + BOOTSTRAP_CFLAGS := -nostdinc > >> + BOOTSTRAP_CFLAGS += -Wall -Wno-unused-label -Wno-unused-function > >> -Wno-unused-variable > >> BOOTSTRAP_CFLAGS += -Wno-unused-but-set-variable -Wno-main > >> BOOTSTRAP_CFLAGS += -fno-strict-aliasing -frounding-math > >> BOOTSTRAP_CFLAGS += -Wfatal-errors > >> @@ -63,3 +85,7 @@ Index: makefile > >> BOOTSTRAP_OBJ := $(patsubst %.c,%.o,$(sort $(wildcard > >> bootstrap/$(FBTARGET)/*.c))) > >> $(BOOTSTRAP_OBJ): %.o: %.c > >> $(QUIET_CC)$(CC) -c $(BOOTSTRAP_CFLAGS) $< -o $@ > >> +-endif > >> + > >> + # Use gcc to link fbc from the bootstrap .o's > >> + # (assuming the rtlib was built already) >