RetroBSD

2.11BSD operating system for microcontrollers
It is currently Thu Sep 24, 2020 8:09 pm

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Wed Mar 12, 2014 11:00 pm 
Hi,
Has anyone managed to build the latest version of RetroBSD on Mac OS X 10.9??
I've built the latest versions of the gnu tool chain for a mips-elf target & can't see to be able to build retrobsd with it

Code:
Using built-in specs.
COLLECT_GCC=mips-elf-gcc
COLLECT_LTO_WRAPPER=/usr/local/mips-gcc/libexec/gcc/mips-elf/4.8.2/lto-wrapper
Target: mips-elf
Configured with: ../gcc-4.8.2/configure --target=mips-elf --prefix=/usr/local/mips-gcc --enable-languages=c,c++ --with-arch-32=mips32r2 --with-mpfr=/usr/local/mips-gcc --with-gmp=/usr/local/mips-gcc --with-mpc=/usr/local/mips-gcc --enable-lto --disable-nls --disable-shared --disable-libstdc___v3 --disable-decimal-float --disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --disable-libquadmath
Thread model: single
gcc version 4.8.2 (GCC)


Running make results in
Code:
make
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C tools
for i in elf2aout fsutil virtualmips mkrd configsys; do /Applications/Xcode.app/Contents/Developer/usr/bin/make -C $i  DESTDIR= all; done
mips-elf-gcc -g -O -Wall   -c -o elf2aout.o elf2aout.c
elf2aout.c:32:23: fatal error: sys/types.h: No such file or directory
 #include <sys/types.h>
                       ^
compilation terminated.
make[2]: *** [elf2aout.o] Error 1
gcc -g -O -Wall   -c -o fsutil.o fsutil.c
gcc -g -O -Wall   -c -o superblock.o superblock.c
gcc -g -O -Wall   -c -o inode.o inode.c
gcc -g -O -Wall   -c -o create.o create.c
gcc -g -O -Wall   -c -o check.o check.c
gcc -g -O -Wall   -c -o file.o file.c
gcc -g  -o fsutil fsutil.o superblock.o block.c inode.o create.o check.o file.o
block.c:56:34: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with
      different sign [-Wpointer-sign]
                if (! fs_write_block (fs, bno, (char*) buf)) {
                                               ^~~~~~~~~~~
block.c:28:61: note: passing argument to parameter 'data' here
int fs_write_block (fs_t *fs, unsigned bnum, unsigned char *data)
                                                            ^
block.c:154:34: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with
      different sign [-Wpointer-sign]
                if (! fs_read_block (fs, *bno, (char*) buf))
                                               ^~~~~~~~~~~
block.c:15:60: note: passing argument to parameter 'data' here
int fs_read_block (fs_t *fs, unsigned bnum, unsigned char *data)
                                                           ^
2 warnings generated.
mips-elf-gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT pic32.o -MD -MP -MF .deps/pic32.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o pic32.o pic32.c
pic32.c:10:20: fatal error: string.h: No such file or directory
 #include <string.h>
                    ^
compilation terminated.
make[2]: *** [pic32.o] Error 1
cc -Wall -Werror -O   -c -o mkrd.o mkrd.c
cc -o mkrd mkrd.o 
g++ -MM -Wall -O main.cpp config.cpp mapping.cpp device.cpp cluster.cpp util.cpp core.cpp gstore.cpp > .depend
c++ -Wall -O   -c -o main.o main.cpp
c++ -Wall -O   -c -o config.o config.cpp
c++ -Wall -O   -c -o mapping.o mapping.cpp
c++ -Wall -O   -c -o device.o device.cpp
c++ -Wall -O   -c -o cluster.o cluster.cpp
c++ -Wall -O   -c -o util.o util.cpp
c++ -Wall -O   -c -o core.o core.cpp
c++ -Wall -O   -c -o gstore.o gstore.cpp
g++ -o config main.o config.o mapping.o device.o cluster.o util.o core.o gstore.o -Wall -O
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C lib
ln -s -f ../include/a.out.h .
ln -s -f ../include/ar.h .
ln -s -f ../include/nlist.h .
ln -s -f ../include/ranlib.h .
cc -nostdinc -g -Werror -Wall -DCROSS -I.  -I/usr/include/i386-linux-gnu -I/usr/local/retrobsd/include -I/usr/local/retrobsd/src/cmd/ar -I/usr/local/retrobsd/src/cmd/as   -c -o ar.o /usr/local/retrobsd/src/cmd/ar/ar.c
In file included from /usr/local/retrobsd/src/cmd/ar/ar.c:38:
/usr/local/retrobsd/include/stdio.h:103:6: error: declaration of built-in function 'fprintf' requires inclusion of the header
      <stdio.h> [-Werror,-Wbuiltin-requires-header]
int      fprintf (FILE *, const char *, ...);
         ^
/usr/local/retrobsd/include/stdio.h:106:6: error: incompatible redeclaration of library function 'snprintf'
      [-Werror,-Wincompatible-library-redeclaration]
int      snprintf (char *, size_t, const char *, ...);
         ^
/usr/local/retrobsd/include/stdio.h:106:6: note: 'snprintf' is a builtin with type 'int (char *, unsigned long, const char *, ...)'
/usr/local/retrobsd/include/stdio.h:108:6: error: declaration of built-in function 'fscanf' requires inclusion of the header
      <stdio.h> [-Werror,-Wbuiltin-requires-header]
int      fscanf (FILE *, const char *, ...);
         ^
/usr/local/retrobsd/include/stdio.h:119:6: error: incompatible redeclaration of library function 'vsnprintf'
      [-Werror,-Wincompatible-library-redeclaration]
int      vsnprintf (char *, size_t, const char *, va_list);
         ^
/usr/local/retrobsd/include/stdio.h:119:6: note: 'vsnprintf' is a builtin with type 'int (char *, unsigned long, const char *,
      __va_list_tag *)'
/usr/local/retrobsd/include/stdio.h:121:6: error: declaration of built-in function 'vfscanf' requires inclusion of the header
      <stdio.h> [-Werror,-Wbuiltin-requires-header]
int      vfscanf (FILE *, const char *, va_list);
         ^
In file included from /usr/local/retrobsd/src/cmd/ar/ar.c:39:
/usr/local/retrobsd/include/string.h:13:7: error: incompatible redeclaration of library function 'strncat'
      [-Werror,-Wincompatible-library-redeclaration]
char    *strncat (char *, const char *, size_t);
         ^
/usr/local/retrobsd/include/string.h:13:7: note: 'strncat' is a builtin with type 'char *(char *, const char *, unsigned long)'
/usr/local/retrobsd/include/string.h:15:7: error: incompatible redeclaration of library function 'strncpy'
      [-Werror,-Wincompatible-library-redeclaration]
char    *strncpy (char *, const char *, size_t);
         ^
/usr/local/retrobsd/include/string.h:15:7: note: 'strncpy' is a builtin with type 'char *(char *, const char *, unsigned long)'
/usr/local/retrobsd/include/string.h:20:5: error: incompatible redeclaration of library function 'strncmp'
      [-Werror,-Wincompatible-library-redeclaration]
int     strncmp (const char *, const char *, size_t);
        ^
/usr/local/retrobsd/include/string.h:20:5: note: 'strncmp' is a builtin with type 'int (const char *, const char *, unsigned long)'
/usr/local/retrobsd/include/string.h:21:8: error: incompatible redeclaration of library function 'strlen'
      [-Werror,-Wincompatible-library-redeclaration]
size_t  strlen (const char *);
        ^
/usr/local/retrobsd/include/string.h:21:8: note: 'strlen' is a builtin with type 'unsigned long (const char *)'
/usr/local/retrobsd/include/string.h:23:5: error: incompatible redeclaration of library function 'memcmp'
      [-Werror,-Wincompatible-library-redeclaration]
int     memcmp (const void *, const void *, size_t);
        ^
/usr/local/retrobsd/include/string.h:23:5: note: 'memcmp' is a builtin with type 'int (const void *, const void *, unsigned long)'
/usr/local/retrobsd/include/string.h:25:10: error: incompatible redeclaration of library function 'memmove'
      [-Werror,-Wincompatible-library-redeclaration]
void    *memmove (void *, const void *, size_t);
         ^
/usr/local/retrobsd/include/string.h:25:10: note: 'memmove' is a builtin with type 'void *(void *, const void *, unsigned long)'
/usr/local/retrobsd/include/string.h:27:7: error: incompatible redeclaration of library function 'memchr'
      [-Werror,-Wincompatible-library-redeclaration]
void    *memchr (const void *, int, size_t);
         ^
/usr/local/retrobsd/include/string.h:27:7: note: 'memchr' is a builtin with type 'void *(const void *, int, unsigned long)'
/usr/local/retrobsd/include/string.h:28:7: error: incompatible redeclaration of library function 'memcpy'
      [-Werror,-Wincompatible-library-redeclaration]
void    *memcpy (void *, const void *, size_t);
         ^
/usr/local/retrobsd/include/string.h:28:7: note: 'memcpy' is a builtin with type 'void *(void *, const void *, unsigned long)'
/usr/local/retrobsd/include/string.h:29:7: error: incompatible redeclaration of library function 'memset'
      [-Werror,-Wincompatible-library-redeclaration]
void    *memset (void *, int, size_t);
         ^
/usr/local/retrobsd/include/string.h:29:7: note: 'memset' is a builtin with type 'void *(void *, int, unsigned long)'
/usr/local/retrobsd/include/string.h:39:8: error: incompatible redeclaration of library function 'strcspn'
      [-Werror,-Wincompatible-library-redeclaration]
size_t  strcspn (const char *, const char *);
        ^
/usr/local/retrobsd/include/string.h:39:8: note: 'strcspn' is a builtin with type 'unsigned long (const char *, const char *)'
/usr/local/retrobsd/include/string.h:40:8: error: incompatible redeclaration of library function 'strspn'
      [-Werror,-Wincompatible-library-redeclaration]
size_t  strspn (const char *, const char *);
        ^
/usr/local/retrobsd/include/string.h:40:8: note: 'strspn' is a builtin with type 'unsigned long (const char *, const char *)'
In file included from /usr/local/retrobsd/src/cmd/ar/ar.c:40:
/usr/local/retrobsd/include/stdlib.h:63:7: error: incompatible redeclaration of library function 'calloc'
      [-Werror,-Wincompatible-library-redeclaration]
void    *calloc (size_t, size_t);
         ^
/usr/local/retrobsd/include/stdlib.h:63:7: note: 'calloc' is a builtin with type 'void *(unsigned long, unsigned long)'
/usr/local/retrobsd/include/stdlib.h:68:7: error: incompatible redeclaration of library function 'malloc'
      [-Werror,-Wincompatible-library-redeclaration]
void    *malloc (size_t);
         ^
/usr/local/retrobsd/include/stdlib.h:68:7: note: 'malloc' is a builtin with type 'void *(unsigned long)'
/usr/local/retrobsd/include/stdlib.h:73:7: error: incompatible redeclaration of library function 'realloc'
      [-Werror,-Wincompatible-library-redeclaration]
void    *realloc (void*, size_t);
         ^
/usr/local/retrobsd/include/stdlib.h:73:7: note: 'realloc' is a builtin with type 'void *(void *, unsigned long)'
/usr/local/retrobsd/src/cmd/ar/ar.c:42:13: fatal error: 'getopt.h' file not found
#   include <getopt.h>
            ^
20 errors generated.
make[1]: *** [ar.o] Error 1
make: *** [lib] Error 2



My changes to mk files so fare
Code:
Index: cross.mk
===================================================================
--- cross.mk   (revision 892)
+++ cross.mk   (working copy)
@@ -1,7 +1,7 @@
 DESTDIR      = /usr/local/retrobsd
 MACHINE      = mips
 
-CC      = gcc
+CC      = mips-elf-gcc
 
 AS      = $(CC) -x assembler-with-cpp
 LD      = ld
Index: target.mk
===================================================================
--- target.mk   (revision 892)
+++ target.mk   (working copy)
@@ -20,11 +20,12 @@
 # You can build it from sources, as described on page
 # http://retrobsd.org/wiki/doku.php/doc/toolchain-mips
 ifndef GCCPREFIX
-    GCCPREFIX   = /usr/local/mips-gcc-4.7.2/bin/mips-elf-
+    GCCPREFIX   = /usr/local/mips-gcc/bin/mips-elf-
     LDFLAGS     =
     INCLUDES    =
 endif
 
+GCCPREFIX   = /usr/local/mips-gcc/bin/mips-elf-
 CC      = $(GCCPREFIX)gcc -mips32r2 -EL -msoft-float -nostdinc -fshort-double -I$(TOPSRC)/include $(INCLUDES)
 CXX             = $(GCCPREFIX)g++ -mips32r2 -EL -msoft-float -nostdinc -fshort-double -I$(TOPSRC)/include $(INCLUDES)
 LD      = $(GCCPREFIX)ld
Index: tools/elf2aout/Makefile
===================================================================
--- tools/elf2aout/Makefile   (revision 892)
+++ tools/elf2aout/Makefile   (working copy)
@@ -1,4 +1,4 @@
-CC      = gcc -g
+CC      = mips-elf-gcc -g
 CFLAGS      = -O -Wall
 DESTDIR      = /usr/local
 OBJS      = elf2aout.o
@@ -5,7 +5,7 @@
 PROG      = elf2aout
 
 # For Mac OS X
-#LIBS      = -largp
+LIBS      = -largp
 
 all:      $(PROG)
 
Index: tools/virtualmips/Makefile
===================================================================
--- tools/virtualmips/Makefile   (revision 892)
+++ tools/virtualmips/Makefile   (working copy)
@@ -12,7 +12,7 @@
 # UBW32 with UART console
 #CFLAGS      = -DSIM_PIC32 -DPIC32MX7 -DUBW32
 
-CC          = gcc -g
+CC          = mips-elf-gcc -g
 CFLAGS      += -Wall -MT $@ -MD -MP -MF .deps/$*.dep -I/opt/local/include -I/opt/local/include/libelf
 LIBS      = -lpthread -lelf


Top
  
 
PostPosted: Fri Apr 11, 2014 7:01 pm 

Joined: Fri Apr 11, 2014 6:57 pm
Posts: 12
I guess /usr/bin/gcc being clang really puts a spanner in the works


Top
 Profile  
 
PostPosted: Wed Apr 16, 2014 7:38 pm 
Contributor

Joined: Mon Apr 29, 2013 1:56 am
Posts: 196
AFAIR, I only needed to change target.mk (but that's as of just before the move to gihub):

Code:
# chipKIT PIC32 compiler on Linux
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Download from https://github.com/jasonkajita/chipKIT-cxx/downloads
# and unzip to /usr/local.
# Need to copy pic32-tools/pic32mx/include/stdarg.h
# to pic32-tools/lib/gcc/pic32mx/4.5.1/include.
# MPLABX C32 compiler doesn't support some functionality
# we need, so use chipKIT compiler by default.
ifndef GCCPREFIX
    GCCPREFIX   = /usr/local/mips-gcc-4.7.2/bin/mips-elf-
    LDFLAGS     = -Wl,--oformat=elf32-littlemips
    INCLUDES    = -I/usr/local/mips-gcc-4.7.2/include
endif


Top
 Profile  
 
PostPosted: Thu Apr 17, 2014 11:44 pm 

Joined: Fri Apr 11, 2014 6:57 pm
Posts: 12
that's on Mavericks with Xcode 5?


Top
 Profile  
 
PostPosted: Fri Apr 18, 2014 12:14 am 

Joined: Fri Apr 11, 2014 6:57 pm
Posts: 12
Fetched the code from github repo & ran make (without any modification), much better progress, but it still failed, pic32 toolchain is installed in /usr/local/pic32-tools


Code:
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C tools
for i in elf2aout fsutil virtualmips mkrd configsys icache; do /Applications/Xcode.app/Contents/Developer/usr/bin/make -C $i  DESTDIR= all; done
gcc -g -O -Wall   -c -o elf2aout.o elf2aout.c
gcc -g  -o elf2aout elf2aout.o
gcc -g -O -Wall   -c -o fsutil.o fsutil.c
gcc -g -O -Wall   -c -o superblock.o superblock.c
gcc -g -O -Wall   -c -o inode.o inode.c
gcc -g -O -Wall   -c -o create.o create.c
gcc -g -O -Wall   -c -o check.o check.c
gcc -g -O -Wall   -c -o file.o file.c
gcc -g  -o fsutil fsutil.o superblock.o block.c inode.o create.o check.o file.o
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT pic32.o -MD -MP -MF .deps/pic32.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o pic32.o pic32.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT pic32_dev_flash.o -MD -MP -MF .deps/pic32_dev_flash.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o pic32_dev_flash.o pic32_dev_flash.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT pic32_dev_uart.o -MD -MP -MF .deps/pic32_dev_uart.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o pic32_dev_uart.o pic32_dev_uart.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT pic32_dev_intcon.o -MD -MP -MF .deps/pic32_dev_intcon.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o pic32_dev_intcon.o pic32_dev_intcon.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT pic32_dev_spi.o -MD -MP -MF .deps/pic32_dev_spi.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o pic32_dev_spi.o pic32_dev_spi.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT pic32_dev_gpio.o -MD -MP -MF .deps/pic32_dev_gpio.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o pic32_dev_gpio.o pic32_dev_gpio.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT dev_sdcard.o -MD -MP -MF .deps/dev_sdcard.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o dev_sdcard.o dev_sdcard.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT dev_swap.o -MD -MP -MF .deps/dev_swap.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o dev_swap.o dev_swap.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT pic32_dev_bmxcon.o -MD -MP -MF .deps/pic32_dev_bmxcon.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o pic32_dev_bmxcon.o pic32_dev_bmxcon.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT pic32_dev_dmacon.o -MD -MP -MF .deps/pic32_dev_dmacon.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o pic32_dev_dmacon.o pic32_dev_dmacon.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT pic32_dev_syscon.o -MD -MP -MF .deps/pic32_dev_syscon.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o pic32_dev_syscon.o pic32_dev_syscon.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT pic32_dev_prefetch.o -MD -MP -MF .deps/pic32_dev_prefetch.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o pic32_dev_prefetch.o pic32_dev_prefetch.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT pic32_dev_adc.o -MD -MP -MF .deps/pic32_dev_adc.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o pic32_dev_adc.o pic32_dev_adc.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT pic32_dev_devcfg.o -MD -MP -MF .deps/pic32_dev_devcfg.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o pic32_dev_devcfg.o pic32_dev_devcfg.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT pic32_dev_rtcc.o -MD -MP -MF .deps/pic32_dev_rtcc.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o pic32_dev_rtcc.o pic32_dev_rtcc.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT pic32_dev_timer.o -MD -MP -MF .deps/pic32_dev_timer.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o pic32_dev_timer.o pic32_dev_timer.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT dev_cs8900.o -MD -MP -MF .deps/dev_cs8900.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o dev_cs8900.o dev_cs8900.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT dev_nand_flash_1g.o -MD -MP -MF .deps/dev_nand_flash_1g.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o dev_nand_flash_1g.o dev_nand_flash_1g.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT dev_ram.o -MD -MP -MF .deps/dev_ram.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o dev_ram.o dev_ram.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT dev_vtty.o -MD -MP -MF .deps/dev_vtty.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o dev_vtty.o dev_vtty.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT device.o -MD -MP -MF .deps/device.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o device.o device.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT vm.o -MD -MP -MF .deps/vm.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o vm.o vm.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT cpu.o -MD -MP -MF .deps/cpu.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o cpu.o cpu.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT mips.o -MD -MP -MF .deps/mips.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o mips.o mips.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT mips_cp0.o -MD -MP -MF .deps/mips_cp0.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o mips_cp0.o mips_cp0.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT mips_exec.o -MD -MP -MF .deps/mips_exec.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o mips_exec.o mips_exec.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT mips_fdd.o -MD -MP -MF .deps/mips_fdd.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o mips_fdd.o mips_fdd.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT crc.o -MD -MP -MF .deps/crc.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o crc.o crc.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT mips_hostalarm.o -MD -MP -MF .deps/mips_hostalarm.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o mips_hostalarm.o mips_hostalarm.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT mempool.o -MD -MP -MF .deps/mempool.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o mempool.o mempool.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT sbox.o -MD -MP -MF .deps/sbox.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o sbox.o sbox.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT utils.o -MD -MP -MF .deps/utils.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o utils.o utils.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT vp_clock.o -MD -MP -MF .deps/vp_clock.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o vp_clock.o vp_clock.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT vp_timer.o -MD -MP -MF .deps/vp_timer.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o vp_timer.o vp_timer.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT net_io.o -MD -MP -MF .deps/net_io.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o net_io.o net_io.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT mips_memory.o -MD -MP -MF .deps/mips_memory.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o mips_memory.o mips_memory.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT debug.o -MD -MP -MF .deps/debug.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o debug.o debug.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT gdb_interface.o -MD -MP -MF .deps/gdb_interface.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o gdb_interface.o gdb_interface.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT main.o -MD -MP -MF .deps/main.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o main.o main.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT mips-dis.o -MD -MP -MF .deps/mips-dis.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o mips-dis.o mips-dis.c
gcc -g -DSIM_PIC32 -DPIC32MX7 -DMAX32 -Wall -MT config.o -MD -MP -MF .deps/config.dep -I/opt/local/include -I/opt/local/include/libelf -O   -c -o config.o config.c
gcc -g  -o pic32 pic32.o pic32_dev_flash.o pic32_dev_uart.o pic32_dev_intcon.o pic32_dev_spi.o pic32_dev_gpio.o dev_sdcard.o dev_swap.o pic32_dev_bmxcon.o pic32_dev_dmacon.o pic32_dev_syscon.o pic32_dev_prefetch.o pic32_dev_adc.o pic32_dev_devcfg.o pic32_dev_rtcc.o pic32_dev_timer.o dev_cs8900.o dev_nand_flash_1g.o dev_ram.o dev_vtty.o device.o vm.o cpu.o mips.o mips_cp0.o mips_exec.o mips_fdd.o crc.o mips_hostalarm.o mempool.o sbox.o utils.o vp_clock.o vp_timer.o net_io.o mips_memory.o debug.o gdb_interface.o main.o mips-dis.o config.o -lpthread -lelf -L/opt/local/lib -lintl         
cc -Wall -Werror -O   -c -o mkrd.o mkrd.c
cc -o mkrd mkrd.o 
g++ -MM -Wall -O main.cpp config.cpp mapping.cpp device.cpp cluster.cpp util.cpp core.cpp gstore.cpp > .depend
c++ -Wall -O   -c -o main.o main.cpp
c++ -Wall -O   -c -o config.o config.cpp
c++ -Wall -O   -c -o mapping.o mapping.cpp
c++ -Wall -O   -c -o device.o device.cpp
c++ -Wall -O   -c -o cluster.o cluster.cpp
c++ -Wall -O   -c -o util.o util.cpp
c++ -Wall -O   -c -o core.o core.cpp
c++ -Wall -O   -c -o gstore.o gstore.cpp
g++ -o config main.o config.o mapping.o device.o cluster.o util.o core.o gstore.o -Wall -O
gcc -g -O -Wall   -c -o ice2aout.o ice2aout.c
gcc -g  -o ice2aout ice2aout.o
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C lib
ln -s -f ../include/a.out.h .
ln -s -f ../include/ar.h .
ln -s -f ../include/nlist.h .
ln -s -f ../include/ranlib.h .
cc -nostdinc -fno-builtin -g -Werror -Wall -DCROSS -I.  -I/usr/include -I/Users/someone/Sandbox/retrobsd/include -I/Users/someone/Sandbox/retrobsd/src/cmd/ar -I/Users/someone/Sandbox/retrobsd/src/cmd/as   -c -o ar.o /Users/someone/Sandbox/retrobsd/src/cmd/ar/ar.c
/Users/someone/Sandbox/retrobsd/src/cmd/ar/ar.c:42:13: fatal error: 'getopt.h' file not found
#   include <getopt.h>
            ^
1 error generated.
make[1]: *** [ar.o] Error 1
make: *** [lib] Error 2


Top
 Profile  
 
PostPosted: Fri Apr 18, 2014 6:10 am 
Contributor

Joined: Mon Apr 29, 2013 1:56 am
Posts: 196
venture37 wrote:
Fetched the code from github repo & ran make (without any modification), much better progress, but it still failed, pic32 toolchain is installed in /usr/local/pic32-tools

Code:
...
cc -nostdinc -fno-builtin -g -Werror -Wall -DCROSS -I.  -I/usr/include -I/Users/someone/Sandbox/retrobsd/include -I/Users/someone/Sandbox/retrobsd/src/cmd/ar -I/Users/someone/Sandbox/retrobsd/src/cmd/as   -c -o ar.o /Users/someone/Sandbox/retrobsd/src/cmd/ar/ar.c
/Users/someone/Sandbox/retrobsd/src/cmd/ar/ar.c:42:13: fatal error: 'getopt.h' file not found
#   include <getopt.h>
            ^
1 error generated.
make[1]: *** [ar.o] Error 1
make: *** [lib] Error 2


This dump and error indicate that the CROSS macro is defined. I can see it's defined in cross.mk, but cross.mk is not included in ar's Makefile, target.mk is.

So, where do you get this macro from?

I just synced my fork from upstream, cloned it in my Ubuntu VM, changed target.mk to point to my installation of MIPS gcc and rebuilt everything successfully with make (without any parms, just sudo make).


Top
 Profile  
 
PostPosted: Fri Apr 18, 2014 8:57 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
cross.mk is included at specific points in the build process to compile RetroBSD programs natively under the host OS so that they can then be used as part of the build process. Only specific things want cross compiling in that way, things like "ar" and other similar tools.

The cross-compiling setup is quite linux specific and will require some tweaking to work under other operating systems. It relies on things being in known locations, so you would need to add some bits to cross.mk to find the files it needs - mainly take a look at the bottom bit where it defines the include paths that are added to CFLAGS - those are done depending on 32- or 64-bit linux at the moment.

If you can find where the missing header files are located then alter that section to include a check for OS X then you may have some luck with it.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Fri Apr 18, 2014 9:10 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Option -DCROSS in used when building AS and LD in lib/ - needed to compile the target /lib/libc.a and other libraries. See lib/Makefile.

But what's exactly the problem with getopt.h? On my iMac I have it preinstalled:
Code:
$ ls -l /usr/include/getopt.h
-r--r--r--  1 root  wheel  3260 10 апр 22:06 /usr/include/getopt.h


Modified 10 April - seems like it was the last Xcode update.


Top
 Profile  
 
PostPosted: Fri Apr 18, 2014 10:47 am 
Contributor

Joined: Mon Apr 29, 2013 1:56 am
Posts: 196
majenko wrote:
cross.mk is included at specific points in the build process to compile RetroBSD programs natively under the host OS...


Of course! Stupid me.


Top
 Profile  
 
PostPosted: Fri Apr 18, 2014 7:23 pm 

Joined: Fri Apr 11, 2014 6:57 pm
Posts: 12
vak wrote:
Option -DCROSS in used when building AS and LD in lib/ - needed to compile the target /lib/libc.a and other libraries. See lib/Makefile.

But what's exactly the problem with getopt.h? On my iMac I have it preinstalled:
Code:
$ ls -l /usr/include/getopt.h
-r--r--r--  1 root  wheel  3260 10 апр 22:06 /usr/include/getopt.h


Modified 10 April - seems like it was the last Xcode update.


This was the key.
I didn't have any headers in /usr/include/, in fact, /usr/include didn't exist.

Turns out there's a difference between installing the command line tools from within Xcode & installing them from terminal.

Code:
xcode-select --install
allows you to reinstall the command line tools & it creates & populates /usr/include (if installed from Xcode, things are all burried in /Applications/Xcode.app.

Rerunning make after that causes the build to fail
Code:
make[1]: *** No rule to make target `etc/phones', needed by `filesys.img'.  Stop.
make: *** [all] Error 2


manually touching
Quote:
etc/phones
etc/remote
lib/retroImage
share/re.help


allows the build to succeed


Top
 Profile  
 
PostPosted: Fri Apr 18, 2014 7:45 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
That last error then means that some commands (or the libraries they depend on) didn't compile right.

Run
Code:
$ make >/dev/null

and you may see a nasty error.

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Sat Apr 19, 2014 1:44 am 

Joined: Fri Apr 11, 2014 6:57 pm
Posts: 12
edited shell config file & appended the location byacc is installed to $PATH instead of manually doing it by hand at the terminal, re-ran build & things worked, tried a git reset --hard && make clean cleanall, just to be sure


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission