Thanks Luis.  Now I'm just curious why the header needs that declaration at
all, then?  You say it "specifies to that unit of compilation information
about these arrays" but what is the functional purpose or difference of
doing so versus not?  Again, please excuse me if this is a poor question.

On Wed, Jul 12, 2023 at 1:13 PM Luis Felipe Strano Moraes <
luis.str...@gmail.com> wrote:

> The declaration with extern specifies to that unit of compilation
> information about these arrays, but the definition (when memory is actually
> reserved as well) happens in another unit.
>
> As I mentioned, GCC usually updates how it handles somethings based on the
> spec of the C language over time. In this particular case, the issue was
> caused by an updated handling of extern in GCC 10:
> https://gcc.gnu.org/gcc-10/porting_to.html
>
> See the "default to -fno-common" section at the very beginning of that
> page to understand what the change was and why it was done.
>
> Best regards,
>
>
>
>
> On Wed, Jul 12, 2023 at 5:08 AM James Dempsey <james.e.demp...@gmail.com>
> wrote:
>
>> Thank you for your quick attention to this, Luis, that certain works and
>> compiles successfully.
>>
>> One question, again not a C programmer, but why both `extern` the
>> "declaration" and move the "definition", if those are the correct terms?
>>
>> On Tue, Jul 11, 2023 at 10:05 PM Luis Felipe Strano Moraes <
>> luis.str...@gmail.com> wrote:
>>
>>> That is perfectly fine, the other way of fixing it would be this way
>>> which was apparently already committed to the git tree but no new release
>>> was made that includes it:
>>>
>>> http://git.savannah.gnu.org/cgit/gnugo.git/commit/?h=ttn-maint&id=54b697abcd2ccfb2fe0f5a7454da4a14118483ca
>>>
>>> The reason this error was encountered was due to changes in GCC as it
>>> evolves where it starts treating some things differently, and it has been a
>>> long time since GNU Go 3.8 was released.
>>>
>>> Best regards,
>>>
>>>
>>> On Tue, Jul 11, 2023 at 5:19 PM James Dempsey <james.e.demp...@gmail.com>
>>> wrote:
>>>
>>>> I ran into an issue with compiling GNU Go 3.8 on Amazon Linux 2023 (gcc
>>>> (GCC) 11.3.1 20221121 (Red Hat 11.3.1-4)).
>>>>
>>>> I receive the follow error when running `./configure` and `make`:
>>>>
>>>> gcc  -g -O2   -o mkpat  mkpat.o transform.o dfa.o ../utils/libutils.a
>>>>> -lm
>>>>> /usr/bin/ld:
>>>>> transform.o:/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns/../engine/liberty.h:861:
>>>>> multiple definition of `meaningless_white_moves';
>>>>> mkpat.o:/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns/../engine/liberty.h:861:
>>>>> first defined here
>>>>> /usr/bin/ld:
>>>>> transform.o:/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns/../engine/liberty.h:860:
>>>>> multiple definition of `meaningless_black_moves';
>>>>> mkpat.o:/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns/../engine/liberty.h:860:
>>>>> first defined here
>>>>> /usr/bin/ld:
>>>>> dfa.o:/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns/../engine/liberty.h:861:
>>>>> multiple definition of `meaningless_white_moves';
>>>>> mkpat.o:/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns/../engine/liberty.h:861:
>>>>> first defined here
>>>>> /usr/bin/ld:
>>>>> dfa.o:/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns/../engine/liberty.h:860:
>>>>> multiple definition of `meaningless_black_moves';
>>>>> mkpat.o:/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns/../engine/liberty.h:860:
>>>>> first defined here
>>>>> collect2: error: ld returned 1 exit status
>>>>> make[2]: *** [Makefile:371: mkpat] Error 1
>>>>> make[2]: Leaving directory
>>>>> '/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8/patterns'
>>>>> make[1]: *** [Makefile:232: all-recursive] Error 1
>>>>> make[1]: Leaving directory '/home/ec2-user/kgsGtp-3.5.23/gnugo-3.8'
>>>>> make: *** [Makefile:168: all] Error 2
>>>>
>>>>
>>>> My solution was to move the following lines from `liberty.h` to
>>>> `unconditional.c`:
>>>>
>>>> /* Unconditionally meaningless moves. */
>>>>> int meaningless_black_moves[BOARDMAX];
>>>>> int meaningless_white_moves[BOARDMAX];
>>>>
>>>>
>>>> This change allowed me to compile successfully.
>>>>
>>>> I am not a C programmer.  Is this a reasonable change to make
>>>> and does not functionally affect the program?  Why was this error
>>>> encountered in the first place?
>>>>
>>>> Thank you.
>>>> _______________________________________________
>>>> gnugo-devel mailing list
>>>> gnugo-devel@gnu.org
>>>> https://lists.gnu.org/mailman/listinfo/gnugo-devel
>>>>
>>>
>>>
>>> --
>>> Luís Felipe Strano Moraes
>>> _______________________________________________
>>> gnugo-devel mailing list
>>> gnugo-devel@gnu.org
>>> https://lists.gnu.org/mailman/listinfo/gnugo-devel
>>>
>> _______________________________________________
>> gnugo-devel mailing list
>> gnugo-devel@gnu.org
>> https://lists.gnu.org/mailman/listinfo/gnugo-devel
>>
>
>
> --
> Luís Felipe Strano Moraes
> _______________________________________________
> gnugo-devel mailing list
> gnugo-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/gnugo-devel
>
_______________________________________________
gnugo-devel mailing list
gnugo-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/gnugo-devel

Reply via email to