[LLVMLinux] Regression: rev 208833/208834 break linux kernel build in ASM handling

Hi !

Our buildbot found this regression while compiling the kernel with clang:

A bisection points to

475ac5d302ba84ac13d34a9215c29c1a38ca5690 is the first bad commit
commit 475ac5d302ba84ac13d34a9215c29c1a38ca5690
Author: Eric Christopher <echristo@gmail.com>

A bisection points to
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208833
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208834

Hi Jan,

These commits really seem to have no impact whatsoever (default is
still false, no changes in default command line options).

--- snip ---
/tmp/vfpmodule-0d3341.s: Assembler messages:
/tmp/vfpmodule-0d3341.s:64: Error: junk at end of line, first unrecognized
character is `"'
/tmp/vfpmodule-0d3341.s:65: Error: junk at end of line, first unrecognized
character is `"'
/tmp/vfpmodule-0d3341.s:66: Error: junk at end of line, first unrecognized
character is `"'
--- snip ---

Can you send the contents of the temporary ASM file, so we have an
idea what's the offending junk?

cheers,
--renato

Hi !

I reproduced it on the file init/main.c

The invocation, log and main.i / main.s is attached.

main.c.clang.log (18.4 KB)

main.i.bz2 (171 KB)

main.s.bz2 (91.6 KB)

The unrecognized junk is (path shortened, so don't worry):

.Ldebug_range:
  .file 1 "/src/linux/include/linux" "export.h"
  .file 2 "/src/linux/init" "main.c"
  .file 3 "/src/linux/include/linux" "types.h"
  .file 4 "/src/linux/include/linux" "init.h"
  .file 5 "/src/linux/include/linux" "moduleparam.h"
  .file 6 "/src/linux/include/asm-generic" "int-ll64.h"
  .file 7 "/src/linux/include/linux" "kernel.h"
  .file 8 "/src/linux/include/linux" "completion.h"
  .file 9 "/src/linux/arch/arm/include/asm" "spinlock_types.h"
  .file 10 "/src/linux/include/linux" "spinlock_types.h"
  .file 11 "/src/linux/include/linux" "wait.h"
  .file 12 "/src/linux/include/asm-generic" "preempt.h"
  .file 13 "/src/linux/arch/arm/include/asm" "thread_info.h"
  .file 14 "/src/linux/include/linux" "sched.h"
  .file 15 "/src/linux/include/linux" "llist.h"
  .file 16 "/src/linux/include/linux" "rbtree.h"
  .file 17 "/src/linux/include/linux" "timerqueue.h"
  .file 18 "/src/linux/include/linux" "ktime.h"
  .file 19 "/src/linux/include/linux" "hrtimer.h"
  .file 20 "/src/linux/include/uapi/asm-generic" "posix_types.h"
  .file 21 "/src/linux/include/linux" "cpumask.h"
  .file 22 "/src/linux/include/linux" "plist.h"
  .file 23 "/src/linux/include/linux" "mm_types.h"
  .file 24 "/src/linux/arch/arm/include/asm" "pgtable-2level-types.h"
  .file 25 "/src/linux/include/linux" "rmap.h"
  .file 26 "/src/linux/include/uapi/asm-generic" "int-ll64.h"
  .file 27 "/src/linux/include/linux" "rwsem-spinlock.h"
  .file 28 "/src/linux/include/linux" "mm.h"
  .file 29 "/src/linux/include/linux" "fs.h"
  .file 30 "/src/linux/include/linux" "uidgid.h"
  .file 31 "/src/linux/include/linux" "dcache.h"
  .file 32 "/src/linux/include/linux" "seqlock.h"
  .file 33 "/src/linux/include/linux" "list_bl.h"
  .file 34 "/src/linux/include/linux" "lockref.h"
  .file 35 "/src/linux/include/linux" "path.h"
  .file 36 "/src/linux/include/linux" "module.h"
  .file 37 "/src/linux/include/linux" "kobject.h"
  .file 38 "/src/linux/include/linux" "sysfs.h"
  .file 39 "/src/linux/include/linux" "kobject_ns.h"
  .file 40 "/src/linux/include/linux" "kernfs.h"
  .file 41 "/src/linux/include/linux" "idr.h"
  .file 42 "/src/linux/include/linux" "seq_file.h"
  .file 43 "/src/linux/include/linux" "mutex.h"
  .file 44 "/src/linux/include/linux" "poll.h"
  .file 45 "/src/linux/include/linux" "pid.h"
  .file 46 "/src/linux/include/linux" "kref.h"
  .file 47 "/src/linux/include/linux" "pid_namespace.h"
  .file 48 "/src/linux/include/linux" "slub_def.h"
  .file 49 "/src/linux/include/asm-generic" "atomic-long.h"
  .file 50 "/src/linux/include/linux" "workqueue.h"
  .file 51 "/src/linux/include/linux" "nfs_fs_i.h"
  .file 52 "/src/linux/include/linux" "rwlock_types.h"
  .file 53 "/src/linux/include/linux" "cred.h"
  .file 54 "/src/linux/include/linux" "capability.h"
  .file 55 "/src/linux/arch/arm/include/asm" "uaccess.h"
  .file 56 "/src/linux/arch/arm/include/asm" "module.h"
  .file 57 "/src/linux/include/asm-generic" "bug.h"
  .file 58 "/src/linux/include/uapi/linux" "elf.h"
  .file 59 "/src/linux/include/linux" "lockdep.h"
  .file 60 "/src/linux/include/linux" "writeback.h"
  .file 61 "/src/linux/include/linux" "quota.h"
  .file 62 "/src/linux/include/linux" "projid.h"
  .file 63 "/src/linux/include/uapi/linux" "quota.h"
  .file 64 "/src/linux/include/uapi/linux" "dqblk_xfs.h"
  .file 65 "/src/linux/include/linux" "xattr.h"
  .file 66 "/src/linux/include/linux" "genhd.h"
  .file 67 "/src/linux/include/linux" "device.h"
  .file 68 "/src/linux/include/linux" "pm.h"
  .file 69 "/src/linux/include/linux" "pm_wakeup.h"
  .file 70 "/src/linux/include/linux" "timer.h"
  .file 71 "/src/linux/arch/arm/include/asm" "device.h"
  .file 72 "/src/linux/include/linux" "klist.h"
  .file 73 "/src/linux/include/linux" "blkdev.h"
  .file 74 "/src/linux/include/linux" "smp.h"
  .file 75 "/src/linux/include/linux" "blk_types.h"
  .file 76 "/src/linux/include/linux" "bio.h"
  .file 77 "/src/linux/include/linux" "mempool.h"
  .file 78 "/src/linux/include/linux" "iocontext.h"
  .file 79 "/src/linux/include/linux" "radix-tree.h"
  .file 80 "/src/linux/include/linux" "elevator.h"
  .file 81 "/src/linux/include/linux" "backing-dev.h"
  .file 82 "/src/linux/include/linux" "percpu_counter.h"
  .file 83 "/src/linux/include/linux" "flex_proportions.h"
  .file 84 "/src/linux/include/linux" "shrinker.h"
  .file 85 "/src/linux/include/linux" "nodemask.h"
  .file 86 "/src/linux/include/linux" "list_lru.h"
  .file 87 "/src/linux/include/uapi/linux" "time.h"
  .file 88 "/src/linux/include/linux" "stat.h"
  .file 89 "/src/linux/include/uapi/linux" "fiemap.h"
  .file 90 "/src/linux/include/linux" "cdev.h"
  .file 91 "/src/linux/include/linux" "migrate_mode.h"
  .file 92 "/src/linux/include/linux" "swap.h"
  .file 93 "/src/linux/arch/arm/include/asm" "atomic.h"
  .file 94 "/src/linux/arch/arm/include/asm" "mmu.h"
  .file 95 "/src/linux/include/linux" "uprobes.h"
  .file 96 "/src/linux/include/asm-generic" "cputime_jiffies.h"
  .file 97 "/src/linux/include/linux" "sem.h"
  .file 98 "/src/linux/arch/arm/include/asm" "processor.h"
  .file 99 "/src/linux/include/linux" "perf_event.h"
  .file 100 "/src/linux/include/asm-generic" "local64.h"
  .file 101 "/src/linux/include/uapi/linux" "perf_event.h"
  .file 102 "/src/linux/arch/arm/include/asm" "hw_breakpoint.h"
  .file 103 "/src/linux/include/linux" "irq_work.h"
  .file 104 "/src/linux/arch/arm/include/asm" "ptrace.h"
  .file 105 "/src/linux/include/linux" "nsproxy.h"
  .file 106 "/src/linux/include/linux" "signal.h"
  .file 107 "/src/linux/arch/arm/include/asm" "signal.h"
  .file 108 "/src/linux/include/linux" "tty.h"
  .file 109 "/src/linux/include/linux" "tty_driver.h"
  .file 110 "/src/linux/include/uapi/asm-generic" "termbits.h"
  .file 111 "/src/linux/include/uapi/asm-generic" "termios.h"
  .file 112 "/src/linux/include/uapi/linux" "termios.h"
  .file 113 "/src/linux/include/linux" "tty_ldisc.h"
  .file 114 "/src/linux/include/linux" "task_io_accounting.h"
  .file 115 "/src/linux/include/uapi/linux" "resource.h"
  .file 116 "/src/linux/include/uapi/asm-generic" "signal-defs.h"
  .file 117 "/src/linux/include/linux" "seccomp.h"
  .file 118 "/src/linux/include/uapi/asm-generic" "siginfo.h"
  .file 119 "/src/linux/include/linux" "cgroup.h"
  .file 120 "/src/linux/include/linux" "percpu-refcount.h"
  .file 121 "/src/linux/arch/arm/include/asm" "fpstate.h"
  .file 122 "/src/linux/include/linux" "thread_info.h"
  .file 123 "/src/linux/include/uapi/asm-generic" "poll.h"
  .file 124 "/src/linux/include/linux" "rcupdate.h"
  .file 125 "/src/linux/include/linux" "mempolicy.h"
  .file 126 "/src/linux/include/linux" "kmod.h"
  .file 127 "/src/linux/include/linux" "cpuset.h"
  .file 128 "/src/linux/include/linux" "spinlock.h"
  .file 129 "/src/linux/include/linux" "spinlock_api_smp.h"
  .file 130 "/src/linux/arch/arm/include/asm" "spinlock.h"
  .file 131 "/src/linux/arch/arm/include/asm" "irqflags.h"
  .file 132 "/src/linux/include/linux" "ftrace.h"
  .file 133 "/src/linux/include/linux" "efi.h"
  .file 134 "/src/linux/include/linux" "sfi.h"
  .file 135 "/src/linux/include/linux" "delayacct.h"
  .file 136 "/src/linux/include/linux" "taskstats_kern.h"
  .file 137 "/src/linux/include/linux" "security.h"
  .file 138 "/src/linux/include/linux" "acpi.h"
  .file 139 "/src/linux/include/linux" "kmemleak.h"
  .file 140 "/src/linux/include/linux" "debugobjects.h"
  .file 141 "/src/linux/include/linux" "page_cgroup.h"
  .file 142 "/src/linux/include/linux" "context_tracking.h"
  .file 143 "/src/linux/include/linux" "tick.h"
  .file 144 "/src/linux/include/linux" "jump_label.h"
  .file 145 "/src/linux/include/linux" "bootmem.h"
  .file 146 "/src/linux/include/linux" "stackprotector.h"
  .file 147 "/src/linux/include/linux" "mmzone.h"
  .file 148 "/src/linux/include/linux" "memory_hotplug.h"
  .file 149 "/src/linux/include/linux" "stddef.h"
  .file 150 "/src/linux/include/linux" "cpu.h"

I’ll look.

Hi !

Our buildbot found this regression while compiling the kernel with clang:

A bisection points to

475ac5d302ba84ac13d34a9215c29c1a38ca5690 is the first bad commit
commit 475ac5d302ba84ac13d34a9215c29c1a38ca5690
Author: Eric Christopher <echristo@gmail.com>
Date: Thu May 15 01:10:50 2014 +0000

    Unify command line handling of MCTargetOptions and remove extra
    options and code. No functional change.

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208833
91177308-0d34-0410-b5e6-96231b3b80d8

8454a4b9373bca5d2a8f596ef1c33826171729bd is the first bad commit
commit 8454a4b9373bca5d2a8f596ef1c33826171729bd
Author: Eric Christopher <echristo@gmail.com>
Date: Thu May 15 01:21:56 2014 +0000

    Fill in the options in the MCOptions struct directly like the other
    options.

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208834
91177308-0d34-0410-b5e6-96231b3b80d8

Before:

http://buildbot.llvm.linuxfoundation.org/builders/2_llvm/builds/8/steps/shell_3/logs/stdio

After:

http://buildbot.llvm.linuxfoundation.org/builders/2_llvm/builds/41/steps/shell_3/logs/stdio

--- snip ---
/tmp/vfpmodule-0d3341.s: Assembler messages:
/tmp/vfpmodule-0d3341.s:64: Error: junk at end of line, first unrecognized
character is `"'
/tmp/vfpmodule-0d3341.s:65: Error: junk at end of line, first unrecognized
character is `"'
/tmp/vfpmodule-0d3341.s:66: Error: junk at end of line, first unrecognized
character is `"'
--- snip ---

I found the same thing.

The problem is that the 3-arg form of .file is now backwards w.r.t. setting
of integrated assembler. To reproduce:

$ clang -no-integrated-as -S a/x.c -o - -g | grep file
.file 1 "a" "x.c"

vs.

$ clang -S a/x.c -o - -g | grep file
.file 1 "a/x.c"

Binutils doesn't support the 3-arg format, so unless we know we're using
the integrated assembler we can't emit that. As I recall, clang -S would
emit the 2-argument form unless you passed -integrated-as -S on the
command-line.

Nick

Should be fixed in r209017, missed a ! when moving a conditional up.

Sorry about the breakage.

-eric

Should be fixed now.

-eric

Hi Eric,

that worked. Thanks for fixing !

http://buildbot.llvm.linuxfoundation.org/builders/3_clang/builds/30/steps/shell_3/logs/stdio

Best,