Issue 50 in teyjus: Build error on Mac OSX Snow Leopard - undefined symbol "_bswap_64"

14 views
Skip to first unread message

tey...@googlecode.com

unread,
Dec 1, 2010, 2:37:31 AM12/1/10
to teyjus...@googlegroups.com
Status: New
Owner: ----

New issue 50 by steven.r...@internode.on.net: Build error on Mac OSX Snow
Leopard - undefined symbol "_bswap_64"
http://code.google.com/p/teyjus/issues/detail?id=50

What steps will reproduce the problem?
omake tjsim; omake tjlink

What is the expected output? What do you see instead?
Smooth build expected. Output includes a lot of warnings about wrong data
types and ends with

code.c: In function ‘WriteCode’:
code.c:390: warning: format ‘%lx’ expects type ‘long unsigned int’, but
argument 4 has type ‘off_t’
code.c:401: warning: format ‘%lx’ expects type ‘long unsigned int’, but
argument 3 has type ‘off_t’
- build source tjsim.opt
+ ocamlopt.opt -warn-error A -I . -I compiler -I disassembler -I simulator
-I loader -o tjsim.opt front/parseargs.cmx compiler/errormsg.cmx
compiler/option.cmx compiler/symbol.cmx compiler/table.cmx
compiler/absyn.cmx compiler/bytecode.cmx compiler/pervasive.cmx
compiler/pervasiveutils.cmx loader/loadmodtab.cmx front/simerrors.cmx
front/module.cmx compiler/preabsyn.cmx compiler/lpyacc.cmx
compiler/lplex.cmx compiler/compile.cmx compiler/translate.cmx
compiler/types.cmx compiler/parse.cmx front/readterm.cmx front/query.cmx
front/front.cmx front/simulatorfront.cmx compiler/annvariables.cmx
compiler/instr.cmx compiler/registers.cmx compiler/clausegen.cmx
compiler/clauses.cmx compiler/codegen.cmx compiler/processclauses.cmx
compiler/spitcode.cmx compiler/typereduction.cmx libsim.a
Undefined symbols:
"_bswap_64", referenced from:
_LD_FILE_GETWORD in
libsim.a([=======================================================================================================file.o)=========
] 00625 / 00628
_LK_FILE_GETWord in libsim.a(file.o)
_LK_FILE_PUTWord in libsim.a(file.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
File "caml_startup", line 1, characters 0-1:
Error: Error during linking
*** omake: 625/628 targets are up to date
*** omake: failed (7.89 sec, 78/143 scans, 80/198 rules, 239/1244 digests)
*** omake: targets were not rebuilt because of errors:
source/tjsim.opt

What version of the product are you using? On what operating system?
version 2.0, Mac Snow Leopard 10.6.5

Please provide any additional information below.
_bswap_64 is, I think, meant to come from byteswap.h, which apparently
isn't available on OSX. Related discussion at
http://code.google.com/p/teyjus/issues/detail?id=6 suggests this problem is
fixed, but it doesn't seem to be for me.


tey...@googlecode.com

unread,
Dec 7, 2010, 2:02:57 PM12/7/10
to teyjus...@googlegroups.com
Updates:
Owner: zacharyrsnow

Comment #1 on issue 50 by zacharyr...@gmail.com: Build error on Mac OSX

Snow Leopard - undefined symbol "_bswap_64"
http://code.google.com/p/teyjus/issues/detail?id=50

It looks like we only fixed it for x86, likely because we only had an x86
machine with OS X on it. I'll take a look.

tey...@googlecode.com

unread,
Sep 26, 2011, 6:07:39 PM9/26/11
to teyjus...@googlegroups.com

Comment #2 on issue 50 by Torsten....@sks-ub.de: Build error on Mac OSX
Snow Leopard - undefined symbol "_bswap_64"
http://code.google.com/p/teyjus/issues/detail?id=50

ping!

tey...@googlecode.com

unread,
Sep 26, 2011, 7:42:17 PM9/26/11
to teyjus...@googlegroups.com

Comment #3 on issue 50 by zacharyr...@gmail.com: Build error on Mac OSX
Snow Leopard - undefined symbol "_bswap_64"
http://code.google.com/p/teyjus/issues/detail?id=50

I'll add this to the distribution shortly, but in case you need to build
immediately, the following seems to work (r997 from SVN, all tests pass, OS
X Snow Leopard, 64 bit Macbook Pro).

1. Add the following to .../source/include/byteswap.c:

u_int64_t bswap_64(u_int64_t x)
{
return (((u_int64_t)bswap_32(x & 0xffffffff)) << 32) | bswap_32(x >> 32);
}


2. Add the following to byteswap.h:


u_int64_t bswap_64(u_int64_t x);


3. Build and test:

omake all
omake test

I'll update this issue once I've committed the change to source control.
Sorry for the delay, and thanks for the ping.

tey...@googlecode.com

unread,
Jun 14, 2012, 5:30:45 PM6/14/12
to teyjus...@googlegroups.com
Updates:
Status: Fixed

Comment #4 on issue 50 by zacharyr...@gmail.com: Build error on Mac OSX
Snow Leopard - undefined symbol "_bswap_64"
http://code.google.com/p/teyjus/issues/detail?id=50

This is fixed in r998.

Reply all
Reply to author
Forward
0 new messages