PDP-10 / its

Incompatible Timesharing System
Other
841 stars 80 forks source link

Unable to build pdp11 on M2 mac #2215

Closed eswenson1 closed 2 months ago

eswenson1 commented 10 months ago

When I try to build with make EMULATOR=pdp10-ka all on an M2 Mac, the pdp11 simulator build fails with linker errors referencing pcap_.... I have done a brew install libpcap, which was successful -- but that does't fix the issue.

This is what the output looks like:

/Library/Developer/CommandLineTools/usr/bin/make -C tools/simh pdp11
lib paths are: /usr/lib /usr/X11/lib
include paths are:  /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include /Library/Developer/CommandLineTools/usr/include
using regex: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/regex.h
using mman: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/mman.h
*** Info ***
*** Info *** The simulator you are building could provide more
*** Info *** functionality if video support were available on your system.
*** Info *** Install the MacPorts libSDL2 package to provide this
*** Info *** functionality for your OS X system:
*** Info ***       # port install libsdl2
*** Info ***
*** Info ***
*** Info *** Simulators on your OSX platform can also be built with
*** Info *** extended LAN Ethernet networking support by using VDE Ethernet.
*** Info ***
*** Info *** To build simulator(s) with extended networking support you
*** Info *** should install the MacPorts vde2 package to provide this
*** Info *** functionality for your OS X system:
*** Info ***       # port install vde2
*** Info ***
*** Warning ***
*** Warning *** pdp11 Simulator are being built WITHOUT LAN networking support
*** Warning ***
*** Warning *** To build simulator(s) with networking support you should read
*** Warning *** 0readme_ethernet.txt and follow the instructions regarding the
*** Warning *** needed libpcap components for your Darwin platform
*** Warning ***
fatal: ambiguous argument '+e1db7dec41098cc7e22d2b379a26a7c4561dfa14': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
***
*** pdp11 Simulator being built with:
*** - compiler optimizations and no debugging support. Apple clang version 14.0.3.
*** - WITHOUT Local LAN networking support.
*** - Local LAN packet transports: PCAP NAT(SLiRP)
***
*** git commit id is +e1db7dec41098cc7e22d2b379a26a7c4561dfa14.
fatal: ambiguous argument '+e1db7dec41098cc7e22d2b379a26a7c4561dfa14': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
*** git commit time is .
***
gcc -std=c99 -U__STRICT_ANSI__  -O4 -fno-strict-overflow -flto -fwhole-program -finline-functions -DSIM_GIT_COMMIT_ID=+e1db7dec41098cc7e22d2b379a26a7c4561dfa14  -DSIM_COMPILER="Apple clang version 14.0.3" -I . -D_GNU_SOURCE -DHAVE_REGEX_H -DHAVE_SYS_IOCTL -DHAVE_UTIME -DHAVE_GLOB -DHAVE_SHM_OPEN  sim_BuildROMs.c -o BIN/BuildROMs
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
BIN/BuildROMs
rm -f BIN/BuildROMs
rm -f -rf BIN/BuildROMs.dSYM
gcc -std=c99 -U__STRICT_ANSI__  -O4 -fno-strict-overflow -flto -fwhole-program -finline-functions -DSIM_GIT_COMMIT_ID=+e1db7dec41098cc7e22d2b379a26a7c4561dfa14  -DSIM_COMPILER="Apple clang version 14.0.3" -I . -D_GNU_SOURCE -DHAVE_REGEX_H -DHAVE_SYS_IOCTL -DHAVE_UTIME -DHAVE_GLOB -DHAVE_SHM_OPEN  PDP11/pdp11_fp.c PDP11/pdp11_cpu.c PDP11/pdp11_dz.c PDP11/pdp11_cis.c PDP11/pdp11_lp.c PDP11/pdp11_rk.c PDP11/pdp11_rl.c PDP11/pdp11_rp.c PDP11/pdp11_rx.c PDP11/pdp11_stddev.c PDP11/pdp11_sys.c PDP11/pdp11_tc.c PDP11/pdp11_tm.c PDP11/pdp11_ts.c PDP11/pdp11_io.c PDP11/pdp11_rq.c PDP11/pdp11_tq.c PDP11/pdp11_pclk.c PDP11/pdp11_ry.c PDP11/pdp11_pt.c PDP11/pdp11_hk.c PDP11/pdp11_xq.c PDP11/pdp11_xu.c PDP11/pdp11_vh.c PDP11/pdp11_rh.c PDP11/pdp11_tu.c PDP11/pdp11_cpumod.c PDP11/pdp11_cr.c PDP11/pdp11_rf.c PDP11/pdp11_dl.c PDP11/pdp11_ta.c PDP11/pdp11_rc.c PDP11/pdp11_kg.c PDP11/pdp11_ke.c PDP11/pdp11_dc.c PDP11/pdp11_dmc.c PDP11/pdp11_kmc.c PDP11/pdp11_dup.c PDP11/pdp11_rs.c PDP11/pdp11_vt.c PDP11/pdp11_td.c PDP11/pdp11_io_lib.c PDP11/pdp11_rom.c   scp.c sim_console.c sim_fio.c sim_timer.c sim_sock.c sim_tmxr.c sim_ether.c sim_tape.c sim_disk.c sim_serial.c sim_video.c sim_imd.c sim_card.c -DVM_PDP11 -I PDP11 -DHAVE_PCAP_NETWORK -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ -DBPF_CONST_STRING -Islirp -Islirp_glue -Islirp_glue/qemu -DHAVE_SLIRP_NETWORK -DUSE_SIMH_SLIRP_DEBUG slirp/*.c slirp_glue/*.c -DUSE_NETWORK  -o BIN/pdp11 -L/usr/X11/lib
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
clang: warning: -O4 is equivalent to -O3 [-Wdeprecated]
clang: warning: optimization flag '-fwhole-program' is not supported [-Wignored-optimization-argument]
undef: _pcap_close
undef: _pcap_compile
undef: _pcap_datalink
undef: _pcap_dispatch
undef: _pcap_fileno
undef: _pcap_findalldevs
undef: _pcap_freealldevs
undef: _pcap_freecode
undef: _pcap_geterr
undef: _pcap_lookupnet
undef: _pcap_open_live
undef: _pcap_sendpacket
undef: _pcap_setfilter
Undefined symbols for architecture arm64:
  "_pcap_close", referenced from:
      _eth_devices in cc-3fd0ed.o
      __eth_error in cc-3fd0ed.o
      _eth_close in cc-3fd0ed.o
  "_pcap_compile", referenced from:
      __eth_open_port in cc-3fd0ed.o
      _eth_filter_hash in cc-3fd0ed.o
  "_pcap_datalink", referenced from:
      _eth_devices in cc-3fd0ed.o
  "_pcap_dispatch", referenced from:
      _eth_read in cc-3fd0ed.o
  "_pcap_fileno", referenced from:
      __eth_open_port in cc-3fd0ed.o
  "_pcap_findalldevs", referenced from:
      _eth_devices in cc-3fd0ed.o
  "_pcap_freealldevs", referenced from:
      _eth_devices in cc-3fd0ed.o
  "_pcap_freecode", referenced from:
      __eth_open_port in cc-3fd0ed.o
      _eth_filter_hash in cc-3fd0ed.o
  "_pcap_geterr", referenced from:
      __eth_open_port in cc-3fd0ed.o
      __eth_error in cc-3fd0ed.o
      _eth_filter_hash in cc-3fd0ed.o
  "_pcap_lookupnet", referenced from:
      __eth_open_port in cc-3fd0ed.o
      _eth_filter_hash in cc-3fd0ed.o
  "_pcap_open_live", referenced from:
      _eth_devices in cc-3fd0ed.o
      __eth_open_port in cc-3fd0ed.o
  "_pcap_sendpacket", referenced from:
      __eth_write in cc-3fd0ed.o
  "_pcap_setfilter", referenced from:
      __eth_open_port in cc-3fd0ed.o
      _eth_filter_hash in cc-3fd0ed.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [BIN/pdp11] Error 1
make: *** [tools/simh/BIN/pdp11] Error 2

Note, also, this error, which occurs twice:

fatal: ambiguous argument '+e1db7dec41098cc7e22d2b379a26a7c4561dfa14': unknown revision or path not in the working tree.

Also note that I did install brew install sdl2, so I'm not sure why I'm getting the errors about libsdl2.

eswenson1 commented 10 months ago

I even tried:

export LDFLAGS="-L/opt/homebrew/opt/libpcap/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libpcap/include"

but got the same error. Also, I do have libSDL2 installed:

ls /opt/homebrew/lib/libSDL2*
/opt/homebrew/lib/libSDL2-2.0.0.dylib@  /opt/homebrew/lib/libSDL2.dylib@    /opt/homebrew/lib/libSDL2main.a@
/opt/homebrew/lib/libSDL2.a@        /opt/homebrew/lib/libSDL2_test.a@
larsbrinkhoff commented 10 months ago

This is a SIMH problem. Maybe post your issue here: https://github.com/open-simh/simh

eswenson1 commented 10 months ago

I don't have any issues building the pdp11 binary using the https://github.com/open-simh/simh.

larsbrinkhoff commented 10 months ago

According to this: *** git commit id is +e1db7dec41098cc7e22d2b379a26a7c4561dfa14. you are on a very old commit.

When you update the repository, you also need to do git submodule sync --recursive and then git submodule update --init --recursive to ensure the submodules are also up to date.

eswenson1 commented 10 months ago

Yes, it looks like I flubbed the command (from my history) that did both of these.

Actually, I've been doing:

git submodule sync
git submodule update

I didn't realize I needed the --recursive on both and the --init on update. Thanks.

oilcan-productions commented 5 months ago

After a few weeks of tinkering I finally got almost every emulator to build (except KLH10 Issue #2270 ) The dependency list is quite long though. I am thinking to add all this to the its/boot/dependencies.sh file to at least have a record of the required MacOS dependencies

# this built pdp-10/ka/ks/kl
brew install sdl2
brew install gh
brew install sdl2_net
brew install sdl2_image
brew install pkg-config
brew install libpng zlib
brew install sdl2_config
brew install sdl2_sound
brew install pthread
brew install libpthread-stubs
brew install gtk+3
brew install sdl2_ttf
brew install vde
brew install autoheader
brew install autoconf
brew install aclocal
brew install automake
brew install qt5
brew install openssl
brew install cmake
export LDFLAGS="-L/usr/local/opt/qt@5/lib -L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/qt@5/include -I/usr/local/opt/zlib/include"
export PKG_CONFIG_PATH="/usr/local/opt/zlib/lib/pkgconfig"

2/16/2024: Edited to clean up duplicate installs and fixing a typo

larsbrinkhoff commented 5 months ago

We should try to get this running with GitHub's CI actions. There is currently no way to pass the environment from dependencies.sh to the "make" step. Maybe those lines can be written to a file which is sourced before make runs, or something...