From: Stefano Lattarini Date: Tue, 28 Jun 2011 10:23:48 +0000 (+0200) Subject: lex tests: fix spurious link errors on Solaris X-Git-Tag: ylwrap-refactor-abandoned-branch~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d76d3f56efbaf6152ce5a6795fd0b2a3d0d92dd;p=thirdparty%2Fautomake.git lex tests: fix spurious link errors on Solaris On Solaris 10, linking of lex-generated programs was failing in a couple of lex tests with errors like this: g++ -g -O2 -o joe joe.o -ll Undefined symbol first referenced in file yywrap() joe.o ld: fatal: Symbol referencing errors. No output written to joe collect2: ld returned 1 exit status This change fixes it, also fixing at once potential problems for systems that don't have a "lex library" (this happens for example when cross-compiling from GNU/Linux to MinGW). * tests/lex-depend-cxx.test (joe.ll, moe.l++): Define a dummy `yywrap()' function. * tests/lex-clean-cxx.test (mainfoo.cc, mainbar.cpp, mainbaz.c++, mainqux.cxx): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 611126dfb..0553c9585 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2011-06-28 Stefano Lattarini + + lex tests: fix spurious link errors on Solaris + On Solaris 10, linking of lex-generated programs was failing in a + couple of lex tests with errors like this: + g++ -g -O2 -o joe joe.o -ll + Undefined symbol first referenced in file + yywrap() joe.o + ld: fatal: Symbol referencing errors. No output written to joe + collect2: ld returned 1 exit status + This change fixes it, also fixing at once potential problems for + systems that don't have a "lex library" (this happens for example + when cross-compiling from GNU/Linux to MinGW). + * tests/lex-depend-cxx.test (joe.ll, moe.l++): Define a dummy + `yywrap()' function. + * tests/lex-clean-cxx.test (mainfoo.cc, mainbar.cpp, mainbaz.c++, + mainqux.cxx): Likewise. + 2011-06-23 Stefano Lattarini docs: avoid a footnote, some related rewordings and improvements diff --git a/tests/lex-clean-cxx.test b/tests/lex-clean-cxx.test index 340097748..3f566c466 100755 --- a/tests/lex-clean-cxx.test +++ b/tests/lex-clean-cxx.test @@ -64,6 +64,10 @@ cp parsefoo.lxx parsebar.ll cat > mainfoo.cc << 'END' // This file should contain valid C++ but invalid C. using namespace std; +int yywrap (void) +{ + return 1; +} int main (int argc, char **argv) { extern int yylex (void); diff --git a/tests/lex-depend-cxx.test b/tests/lex-depend-cxx.test index 860a96f3a..9b5416d61 100755 --- a/tests/lex-depend-cxx.test +++ b/tests/lex-depend-cxx.test @@ -53,6 +53,10 @@ cat > joe.ll << 'END' . %% #include "my-hdr.hxx" +int yywrap (void) +{ + return 1; +} int main (int argc, char **argv) { printf("Hello, World!\n");