wjaguar / mtPaint

Mark Tyler's Painting Program
http://mtpaint.sourceforge.net
GNU General Public License v3.0
157 stars 29 forks source link

Build failure with GCC 10 #46

Closed dimkr closed 3 years ago

dimkr commented 3 years ago
.
.
.
/usr/bin/ld: vcode.o:(.bss+0x768): multiple definition of `bkg_x'; main.o:(.bss+0x4a68): first defined here
/usr/bin/ld: vcode.o:(.bss+0x76c): multiple definition of `bkg_rgb'; main.o:(.bss+0x4a6c): first defined here
/usr/bin/ld: vcode.o:(.bss+0x770): multiple definition of `apply_icc'; main.o:(.bss+0x4a70): first defined here
/usr/bin/ld: vcode.o:(.bss+0x774): multiple definition of `lbm_pbm'; main.o:(.bss+0x4a74): first defined here
/usr/bin/ld: vcode.o:(.bss+0x778): multiple definition of `lbm_pack'; main.o:(.bss+0x4a78): first defined here
/usr/bin/ld: vcode.o:(.bss+0x77c): multiple definition of `lbm_untrans'; main.o:(.bss+0x4a7c): first defined here
/usr/bin/ld: vcode.o:(.bss+0x780): multiple definition of `lbm_mask'; main.o:(.bss+0x4a80): first defined here
/usr/bin/ld: vcode.o:(.bss+0x784): multiple definition of `webp_compression'; main.o:(.bss+0x4a84): first defined here
/usr/bin/ld: vcode.o:(.bss+0x788): multiple definition of `webp_quality'; main.o:(.bss+0x4a88): first defined here
/usr/bin/ld: vcode.o:(.bss+0x78c): multiple definition of `webp_preset'; main.o:(.bss+0x4a8c): first defined here
/usr/bin/ld: vcode.o:(.bss+0x790): multiple definition of `tiff_btype'; main.o:(.bss+0x4a90): first defined here
/usr/bin/ld: vcode.o:(.bss+0x794): multiple definition of `tiff_itype'; main.o:(.bss+0x4a94): first defined here
/usr/bin/ld: vcode.o:(.bss+0x798): multiple definition of `tiff_rtype'; main.o:(.bss+0x4a98): first defined here
/usr/bin/ld: vcode.o:(.bss+0x79c): multiple definition of `tiff_predictor'; main.o:(.bss+0x4a9c): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7a0): multiple definition of `zstd_level'; main.o:(.bss+0x4aa0): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7a4): multiple definition of `lzma_preset'; main.o:(.bss+0x4aa4): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7a8): multiple definition of `jp2_rate'; main.o:(.bss+0x4aa8): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7ac): multiple definition of `tga_defdir'; main.o:(.bss+0x4aac): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7b0): multiple definition of `tga_565'; main.o:(.bss+0x4ab0): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7b4): multiple definition of `tga_RLE'; main.o:(.bss+0x4ab4): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7b8): multiple definition of `png_compression'; main.o:(.bss+0x4ab8): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7bc): multiple definition of `jpeg_quality'; main.o:(.bss+0x4abc): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7c0): multiple definition of `silence_limit'; main.o:(.bss+0x4ac0): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7c4): multiple definition of `tiff_zstd'; main.o:(.bss+0x4ac4): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7c8): multiple definition of `tiff_lzma'; main.o:(.bss+0x4ac8): first defined here
/usr/bin/ld: vcode.o:(.bss+0x398): multiple definition of `main_ini'; main.o:(.bss+0x47b0): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7cc): multiple definition of `texteng_con'; main.o:(.bss+0x4f8c): first defined here
/usr/bin/ld: vcode.o:(.data+0x248): multiple definition of `texteng_lf'; main.o:(.bss+0x4f90): first defined here
/usr/bin/ld: vcode.o:(.data+0x24c): multiple definition of `texteng_dpi'; main.o:(.bss+0x4f94): first defined here
/usr/bin/ld: vcode.o:(.data+0x250): multiple definition of `texteng_spc'; main.o:(.bss+0x4f98): first defined here
/usr/bin/ld: vcode.o:(.data+0x254): multiple definition of `texteng_rot'; main.o:(.bss+0x4f9c): first defined here
/usr/bin/ld: vcode.o:(.data+0x258): multiple definition of `texteng_aa'; main.o:(.bss+0x4fa0): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7d0): multiple definition of `sb_rect'; main.o:(.bss+0x4fa4): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7e0): multiple definition of `sb_dist'; main.o:(.bss+0x4fb4): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7e4): multiple definition of `put_pixel_row'; main.o:(.bss+0x4fb8): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7e8): multiple definition of `put_pixel'; main.o:(.bss+0x4fbc): first defined here
/usr/bin/ld: vcode.o:(.bss+0x7ec): multiple definition of `mem_histogram'; main.o:(.bss+0x4fc0): first defined here
/usr/bin/ld: vcode.o:(.bss+0xbec): multiple definition of `mem_background'; main.o:(.bss+0x53c0): first defined here
/usr/bin/ld: vcode.o:(.bss+0xbf0): multiple definition of `mem_pal_ab_c'; main.o:(.bss+0x53c4): first defined here
/usr/bin/ld: vcode.o:(.bss+0xbf4): multiple definition of `mem_pal_id_c'; main.o:(.bss+0x53c8): first defined here
/usr/bin/ld: vcode.o:(.bss+0xbf8): multiple definition of `mem_pal_def_i'; main.o:(.bss+0x53cc): first defined here
/usr/bin/ld: vcode.o:(.bss+0xbfc): multiple definition of `mem_pal_def'; main.o:(.bss+0x53d0): first defined here
/usr/bin/ld: vcode.o:(.bss+0xefc): multiple definition of `mem_continuous'; main.o:(.bss+0x56d0): first defined here
/usr/bin/ld: vcode.o:(.bss+0xf00): multiple definition of `tool_oy'; main.o:(.bss+0x56d4): first defined here
/usr/bin/ld: vcode.o:(.bss+0xf04): multiple definition of `tool_ox'; main.o:(.bss+0x56d8): first defined here
/usr/bin/ld: vcode.o:(.bss+0xf08): multiple definition of `pen_down'; main.o:(.bss+0x56dc): first defined here
/usr/bin/ld: vcode.o:(.bss+0xf0c): multiple definition of `tool_state'; main.o:(.bss+0x56e0): first defined here
/usr/bin/ld: vcode.o:(.bss+0xf20): multiple definition of `mem_col_pat24'; main.o:(.bss+0x56f4): first defined here
/usr/bin/ld: vcode.o:(.bss+0xfe0): multiple definition of `mem_col_pat'; main.o:(.bss+0x57b4): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1020): multiple definition of `mem_pattern'; main.o:(.bss+0x57f4): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1024): multiple definition of `pattern_B'; main.o:(.bss+0x57f8): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1028): multiple definition of `mem_ts'; main.o:(.bss+0x57fc): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1034): multiple definition of `mem_bcsp'; main.o:(.bss+0x5808): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1084): multiple definition of `mem_undo_fail'; main.o:(.bss+0x5858): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1088): multiple definition of `mem_undo_opacity'; main.o:(.bss+0x585c): first defined here
/usr/bin/ld: vcode.o:(.bss+0x108c): multiple definition of `mem_undo_common'; main.o:(.bss+0x5860): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1090): multiple definition of `mem_undo_limit'; main.o:(.bss+0x5864): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1094): multiple definition of `mem_nudge'; main.o:(.bss+0x5868): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1098): multiple definition of `mem_brush_list'; main.o:(.bss+0x586c): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1464): multiple definition of `mem_clip_y'; main.o:(.bss+0x5c38): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1468): multiple definition of `mem_clip_x'; main.o:(.bss+0x5c3c): first defined here
/usr/bin/ld: vcode.o:(.bss+0x146c): multiple definition of `mem_state'; main.o:(.bss+0x5c40): first defined here
/usr/bin/ld: vcode.o:(.bss+0x15a8): multiple definition of `mem_clip'; main.o:(.bss+0x5d7c): first defined here
/usr/bin/ld: vcode.o:(.bss+0x18f0): multiple definition of `mem_image'; main.o:(.bss+0x60c4): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c38): multiple definition of `mem_undo_depth'; main.o:(.bss+0x640c): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c3c): multiple definition of `quan_sqrt'; main.o:(.bss+0x6410): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c40): multiple definition of `smudge_mode'; main.o:(.bss+0x6414): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c44): multiple definition of `flood_slide'; main.o:(.bss+0x6418): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c48): multiple definition of `flood_img'; main.o:(.bss+0x641c): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c4c): multiple definition of `flood_cube'; main.o:(.bss+0x6420): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c50): multiple definition of `flood_step'; main.o:(.bss+0x6428): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c58): multiple definition of `blend_src'; main.o:(.bss+0x6430): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c5c): multiple definition of `blend_mode'; main.o:(.bss+0x6434): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c60): multiple definition of `paint_gamma'; main.o:(.bss+0x6438): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c64): multiple definition of `mem_gradient'; main.o:(.bss+0x643c): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c68): multiple definition of `mem_unmask'; main.o:(.bss+0x6440): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c6c): multiple definition of `mem_blend'; main.o:(.bss+0x6444): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c70): multiple definition of `mem_cselect'; main.o:(.bss+0x6448): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c74): multiple definition of `tint_mode'; main.o:(.bss+0x644c): first defined here
/usr/bin/ld: vcode.o:(.rodata+0x76): multiple definition of `bayer'; main.o:(.rodata+0x2): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c80): multiple definition of `grad_opacity'; main.o:(.bss+0x6458): first defined here
/usr/bin/ld: vcode.o:(.bss+0x1c84): multiple definition of `gradbytes'; main.o:(.bss+0x645c): first defined here
/usr/bin/ld: vcode.o:(.bss+0x3284): multiple definition of `graddata'; main.o:(.bss+0x7a5c): first defined here
/usr/bin/ld: vcode.o:(.bss+0x3338): multiple definition of `grad_y0'; main.o:(.bss+0x7b10): first defined here
/usr/bin/ld: vcode.o:(.bss+0x3340): multiple definition of `grad_x0'; main.o:(.bss+0x7b18): first defined here
/usr/bin/ld: vcode.o:(.bss+0x3348): multiple definition of `grad_path'; main.o:(.bss+0x7b20): first defined here
/usr/bin/ld: vcode.o:(.bss+0x3350): multiple definition of `gradient'; main.o:(.bss+0x7b28): first defined here
/usr/bin/ld: vcode.o:(.bss+0x3c4): multiple definition of `gtk3version'; main.o:(.bss+0x7ca8): first defined here
/usr/bin/ld: vcode.o:(.bss+0x3bc): multiple definition of `tablet_device'; main.o:(.bss+0x7cac): first defined here
/usr/bin/ld: vcode.o:(.bss+0x3d8): multiple definition of `user_break'; main.o:(.bss+0x28): first defined here
/usr/bin/ld: vcode.o:(.bss+0x3c8): multiple definition of `main_window'; main.o:(.bss+0x7cb0): first defined here
.
.
.

Could be related to this change in GCC 10, from https://gcc.gnu.org/gcc-10/porting_to.html:

Default to -fno-common

A common mistake in C is omitting extern when declaring a global variable in a header file. If the header is included by several files it results in multiple definitions of the same variable. In previous GCC versions this error is ignored. GCC 10 defaults to -fno-common, which means a linker error will now be reported. To fix this, use extern in header files when declaring global variables, and ensure each global is defined in exactly one C file. If tentative definitions of particular variables need to be placed in a common block, __attribute__((__common__)) can be used to force that behavior even in code compiled without -fcommon. As a workaround, legacy C code where all tentative definitions should be placed into a common block can be compiled with -fcommon.

      int x;  // tentative definition - avoid in header files

      extern int y;  // correct declaration in a header file

EDIT: -fcommon works around this build failure.

EDIT: I see that configure tries to deal with GCC 10, but:

2021-02-02T19:10:54.3048275Z 
2021-02-02T19:10:57.7682365Z ./configure: line 389: [: : integer expression expected
dimkr commented 3 years ago

gcc -dumpversion returns 9 or 10, not 9.3.0 or 10.2.1:

+ HAVE_CC_VER 9.2
+ MT_VN0=9
+ MT_VN1=
+ MT_VN0=9
+ MT_VN1=
+ MT_VN1=
+ '[' 9 -eq 9 ']'
+ '[' 2 -le '' ']'
configure: line 389: [: : integer expression expected
+ '[' 9 -lt 9 ']'
+ exit 0
wjaguar commented 3 years ago

Thanks for making me aware of this particular type of GCC misconfiguration. :) Naturally an intentional compatibility break (--with-gcc-major-version-only) does not crop up in GCC packages for Slackware.

dimkr commented 3 years ago

Thank you wjaguar, for your great work and dedication.

(I've fixed this issue in https://github.com/wjaguar/mtPaint/pull/48.)

wjaguar commented 3 years ago

I put a slightly shorter fix into 3.50.04