lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Luiz Henrique de Figueiredo <> wrote:

>> small tweaks I have detailed above. I have attached a patch file to this
>> post to make the detailed changes for anyone running OS X (now macOS).
> I'm running OS X 10.11.6 and the only change I need is replacing "-shared"
> with "-bundle -undefined dynamic_lookup" in lua-5.3.4-tests/libs/makefile.
> The compiler is Apple LLVM version 8.0.0 (clang-800.0.42.1).

I accidentally left the modification of the SRC directory in my patch,
I have an updated one I will put on my site that removes that oversight.

I modify the SRC path to append '/src' as I leave the ltests files in the
'test/ltests' directory, which is at the same level as 'src' and 'doc' from
the default Lua distribution, so I needed that addition to compile the
sources via Makefile... which I almost never do, I typically use Xcode.

From what I can determine it looks like under OS X/macOS '-bundle' is the
correct flag, but it seems '-shared' is a synonym under clang to maintain
compatibility. There is also .dylib (dynamic library) which are created
via the '-dynamiclib' flag and have some other requirements.

Are you saying the rest of the Lua Test Suite executes on your system
without the small tweaks to the 3 lua I mentioned? As those tweaks seem to
be platform specific, and we're on the same system, you should also have to
make those adjustment for the complete test suite to succeed.

Okay, so I created your provided Makefile and ran into a few issues.

The first issue was that I got an invalid instruction error the first time
the newly compiled 'lua' tried to run. Under Xcode an additional compiler
flag is added, '-mmacosx-version-min=10.11', which is set when you specify
the target OS X version for your build. I don't know how many people using
OS X build Lua from the Makefile, but this may be an issue for others as
well. A default might be to specify a low version, which will potentially
let Lua compile and work out of the box for greater numbers of people, with
a notice somewhere to adjust the version to the min version they support.

Once I added the '-mmacosx-version-min' flag I also had the edit the ltests
Makefile to add the '-undefined dynamic_lookup' as I just got a bunch of
unknown symbol errors when it tried to compile the test libraries, but that
was an expected error as your test Makefile didn't address that issue.

The last issue is the tests seem to complete in less than 1 second for both
the basic and complete build targets, which obviously means the tests were 
not running in their entirety.

You are specifying "_U=true" for both the basic and complete tests, once I
removed that flag for the complete build target the test suite attempts to
run with all tests enabled... and asserts on main.lua at line 239.

I applied my first fix, and the tests complete until file.lua asserts, at
which point I apply the two fixes for file.lua and retry the tests.

The tests fully complete at this point, however, if I remove the shared test
library '' (and prevent it being rebuilt) the tests will assert out
again in attrib.lua.

Apply that final fix and the test suite will once again run to completion.

Please try disabling the '_U=true' flag for the complete tests on your end
and verify that the test suite also needs the tweaks I provided to fully run
on your system as well? Thanks!