git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Alex Xu (Hello71)" <alex_y_xu@yahoo.ca>
To: git@vger.kernel.org, Elijah Newren <newren@gmail.com>
Subject: Confusing (maybe wrong?) conflict output with ort
Date: Thu, 02 Dec 2021 14:08:20 -0500	[thread overview]
Message-ID: <1638470726.ql5i6zljva.none@localhost> (raw)
In-Reply-To: 1638470726.ql5i6zljva.none.ref@localhost

[-- Attachment #1: Type: text/plain, Size: 7177 bytes --]

Hi all,

After upgrading to git 2.34.1, I tried to rebase [0] onto [1], but 
encountered "strange" conflict results.

git rebase -s recursive main produces [[RECURSIVE]]. It is roughly what 
I expected to be output. If I take all the changes from the upper 
section of the conflict, my changes will be effectively undone. If I 
take all the changes from the lower section, then the upstream changes 
will be undone.

On the other hand, running git rebase -s ort main produces [[ORT]]. I am 
unsure if it is wrong, strictly speaking, but it is certainly unexpected 
and difficult for me to resolve. Selecting the upper section of the 
conflict does erase my changes, as before, but selecting the lower 
section results in syntactically incorrect code (foreach is ended by 
endif). The diff3 output makes even less sense to me.

A script is attached to assist in reproducing my results. Running it 
initializes the repository to the desired state. Then, run "git rebase 
-s strategy master" to produce the conflict.

Thanks,
Alex.

[0] https://gitlab.freedesktop.org/alxu/mesa/-/commit/4ad18ab613101e3489ca2d9e7151125f670e1ea5
[1] https://gitlab.freedesktop.org/alxu/mesa/-/commit/c47fd3dc0062101b3e75a414b17d2765735f7424

[[RECURSIVE]]

<<<<<<< HEAD
use_elf_tls = true
pre_args += '-DUSE_ELF_TLS'

if with_platform_android and get_option('platform-sdk-version') >= 29
  # By default the NDK compiler, at least, emits emutls references instead of
  # ELF TLS, even when building targeting newer API levels.  Make it actually do
  # ELF TLS instead.
  c_args += '-fno-emulated-tls'
  cpp_args += '-fno-emulated-tls'
endif

# -mtls-dialect=gnu2 speeds up non-initial-exec TLS significantly but requires
# full toolchain (including libc) support.
have_mtls_dialect = false
foreach c_arg : get_option('c_args')
  if c_arg.startswith('-mtls-dialect=')
    have_mtls_dialect = true
    break
  endif
endforeach
if not have_mtls_dialect
  # need .run to check libc support. meson aborts when calling .run when
  # cross-compiling, but because this is just an optimization we can skip it
  if meson.is_cross_build()
    warning('cannot auto-detect -mtls-dialect when cross-compiling, using compiler default')
  else
    # -fpic to force dynamic tls, otherwise TLS relaxation defeats check
    gnu2_test = cc.run('int __thread x; int main() { return x; }', args: ['-mtls-dialect=gnu2', '-fpic'], name: '-mtls-dialect=gnu2')
    if gnu2_test.returncode() == 0
      c_args += '-mtls-dialect=gnu2'
      cpp_args += '-mtls-dialect=gnu2'
=======
use_elf_tls = false
if not with_platform_windows or not with_shared_glapi
  pre_args += '-DUSE_ELF_TLS'
  use_elf_tls = true

  if with_platform_android and get_option('platform-sdk-version') >= 29
    # By default the NDK compiler, at least, emits emutls references instead of
    # ELF TLS, even when building targeting newer API levels.  Make it actually do
    # ELF TLS instead.
    c_args += '-fno-emulated-tls'
    cpp_args += '-fno-emulated-tls'
  endif

  # -mtls-dialect=gnu2 speeds up non-initial-exec TLS significantly but requires
  # full toolchain (including libc) support.
  have_mtls_dialect = false
  foreach c_arg : get_option('c_args')
    if c_arg.startswith('-mtls-dialect=')
      have_mtls_dialect = true
      break
    endif
  endforeach
  if not have_mtls_dialect
    # need .run to check libc support. meson aborts when calling .run when
    # cross-compiling, but because this is just an optimization we can skip it
    if meson.is_cross_build()
      warning('cannot auto-detect -mtls-dialect when cross-compiling, using compiler default')
    else
      # -fpic to force dynamic tls, otherwise TLS relaxation defeats check
      gnu2_test = cc.run('int __thread x; int main() { return x; }', args: ['-mtls-dialect=gnu2', '-fpic'], name: '-mtls-dialect=gnu2')
      # https://gitlab.freedesktop.org/mesa/mesa/-/issues/5665
      if gnu2_test.returncode() == 0 and (
           host_machine.cpu_family() != 'x86_64' or
           # https://github.com/mesonbuild/meson/issues/6377
           #cc.get_linker_id() != 'ld.lld' or
           cc.links('''int __thread x; int y; int main() { __asm__(
                  "leaq x@TLSDESC(%rip), %rax\n"
                  "movq y@GOTPCREL(%rip), %rdx\n"
                  "call *x@TLSCALL(%rax)\n"); }''', name: 'split TLSDESC')
           )
        c_args += '-mtls-dialect=gnu2'
        cpp_args += '-mtls-dialect=gnu2'
      endif
>>>>>>> 4ad18ab6131 (meson: check for lld split TLSDESC bug (fixes #5665))
    endif
  endif
endif

[[ORT]]

# -mtls-dialect=gnu2 speeds up non-initial-exec TLS significantly but requires
# full toolchain (including libc) support.
have_mtls_dialect = false
foreach c_arg : get_option('c_args')
  if c_arg.startswith('-mtls-dialect=')
    have_mtls_dialect = true
    break
  endif
<<<<<<< HEAD
endforeach
if not have_mtls_dialect
  # need .run to check libc support. meson aborts when calling .run when
  # cross-compiling, but because this is just an optimization we can skip it
  if meson.is_cross_build()
    warning('cannot auto-detect -mtls-dialect when cross-compiling, using compiler default')
  else
    # -fpic to force dynamic tls, otherwise TLS relaxation defeats check
    gnu2_test = cc.run('int __thread x; int main() { return x; }', args: ['-mtls-dialect=gnu2', '-fpic'], name: '-mtls-dialect=gnu2')
    if gnu2_test.returncode() == 0
      c_args += '-mtls-dialect=gnu2'
      cpp_args += '-mtls-dialect=gnu2'
=======

  # -mtls-dialect=gnu2 speeds up non-initial-exec TLS significantly but requires
  # full toolchain (including libc) support.
  have_mtls_dialect = false
  foreach c_arg : get_option('c_args')
    if c_arg.startswith('-mtls-dialect=')
      have_mtls_dialect = true
      break
    endif
  endforeach
  if not have_mtls_dialect
    # need .run to check libc support. meson aborts when calling .run when
    # cross-compiling, but because this is just an optimization we can skip it
    if meson.is_cross_build()
      warning('cannot auto-detect -mtls-dialect when cross-compiling, using compiler default')
    else
      # -fpic to force dynamic tls, otherwise TLS relaxation defeats check
      gnu2_test = cc.run('int __thread x; int main() { return x; }', args: ['-mtls-dialect=gnu2', '-fpic'], name: '-mtls-dialect=gnu2')
      # https://gitlab.freedesktop.org/mesa/mesa/-/issues/5665
      if gnu2_test.returncode() == 0 and (
           host_machine.cpu_family() != 'x86_64' or
           # https://github.com/mesonbuild/meson/issues/6377
           #cc.get_linker_id() != 'ld.lld' or
           cc.links('''int __thread x; int y; int main() { __asm__(
                  "leaq x@TLSDESC(%rip), %rax\n"
                  "movq y@GOTPCREL(%rip), %rdx\n"
                  "call *x@TLSCALL(%rax)\n"); }''', name: 'split TLSDESC')
           )
        c_args += '-mtls-dialect=gnu2'
        cpp_args += '-mtls-dialect=gnu2'
      endif
>>>>>>> 4ad18ab6131 (meson: check for lld split TLSDESC bug (fixes #5665))
    endif
  endif
endif

[-- Attachment #2: reproducer.sh --]
[-- Type: application/x-shellscript, Size: 4039 bytes --]

       reply	other threads:[~2021-12-02 19:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1638470726.ql5i6zljva.none.ref@localhost>
2021-12-02 19:08 ` Alex Xu (Hello71) [this message]
2021-12-02 23:58   ` Confusing (maybe wrong?) conflict output with ort Elijah Newren
2021-12-03  0:40     ` Alex Xu (Hello71)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1638470726.ql5i6zljva.none@localhost \
    --to=alex_y_xu@yahoo.ca \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).