Christian Weisgerber <[email protected]> writes: > If you build www/w3m on amd64+clang you get this error: > > /usr/bin/ld: terms.o: relocation R_X86_64_PC32 against `COLS ' can not be > used when making a shared object; recompile with -fPIC > > That's because w3m defines global variables COLS and LINES that > clash with those exported by libcurses. The patch below fixes this > by renaming w3m's variables. I used #define rather than manually > patching all occurrences. > > Rationale: termcap(3) and curses(3) are different interfaces, > although our implementation includes them in the same library (which > is available under five different names). COLS and LINES are part > of curses(3). w3m doesn't use the operating system's version of > curses(3); it uses termcap(3) to implement its own variant of curses, > so the COLS and LINES variables it defines are its own. It does > not try to use the ones exported from libcurses. See w3m/terms.c. > Switching COLS and LINES to "extern int" would not be correct > (although it would happen to work). > > w3m users might want to test this to make sure there are no > unintentional side effects.
Not a w3m user, but terminal size handling seems to behave properly with your diff. > ok? ok jca@ -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
